Compare commits

..

9 Commits

Author SHA1 Message Date
Siana Gearz
8e19372adf Merge branch 'V2Baking' of git://github.com/Shyotl/SingularityViewer into V2Baking
Conflicts:
	indra/llrender/llshadermgr.cpp
	indra/newview/llmorphview.cpp
	indra/newview/lltexlayer.cpp
	indra/newview/lltexlayer.h
	indra/newview/lltoolmorph.cpp
	indra/newview/llvoavatar.cpp
	indra/newview/llvoavatar.h
2012-01-06 14:18:46 +01:00
Shyotl
6381e4d9a4 Merge branch 'future' into V2Baking 2011-10-31 20:41:58 -05:00
Shyotl
d9f674218f Lineending fixup 2011-10-31 20:38:41 -05:00
Shyotl
693e3a0555 vary_texture_index only needed in shaders when batching. 2011-10-31 20:38:29 -05:00
Shyotl
8376e890b2 Hide the mouse cursor a bit better when grabbing items in mouselook. 2011-10-31 20:37:11 -05:00
Shyotl
33827bf8b0 Added a bit of debug output for viewer tool states. 2011-10-31 20:36:47 -05:00
Shyotl
06349951d2 Added tracking of requested(and pending) attachments. Moved Ascent code out of attach/detach functions and into their own for better manageability. 2011-10-27 21:41:19 -05:00
Shyotl
4d68dc7c57 LLTexLayer refactored. Tried to keep behavior changes as minimal as possible. Consider as base slate for changes required for multi-wearables. 2011-10-25 16:50:39 -05:00
Shyotl
722e7d09ff Innitial commit. Majority of texture baking moved into LLVOAvatarSelf. Very WIP. Not advisable to build off of this, although it does compile and mostly work. 2011-10-22 20:36:04 -05:00
7518 changed files with 169942 additions and 269044 deletions

1
.gitattributes vendored
View File

@@ -1 +0,0 @@
* text=auto

5
.gitignore vendored
View File

@@ -1,5 +1,4 @@
/installed.xml /installed.xml
/indra/llcommon/llversionviewer.h
/indra/build-* /indra/build-*
/indra/tools/vstool/obj/ /indra/tools/vstool/obj/
*.aps *.aps
@@ -11,16 +10,12 @@
/bin-release /bin-release
/indra/viewer-* /indra/viewer-*
/indra/newview/vivox-runtime/ /indra/newview/vivox-runtime/
/indra/newview/dbghelp.dll
/libraries/ /libraries/
/lib/
*.pyc *.pyc
*.orig *.orig
*.rej *.rej
*.bak *.bak
*~ *~
*.DS_Store
/LICENSES/ /LICENSES/
/edited-files.txt /edited-files.txt
qtcreator-build/ qtcreator-build/
/.pc

View File

@@ -1,114 +0,0 @@
Linden Research, Inc. ("Linden Lab") Viewer FLOSS License Exception v0.5
The Linden Lab Exception for Free/Libre and Open Source Software-only
Applications Using Linden Lab Viewer Software (the "FLOSS Exception").
Exception Intent
Linden Lab is releasing the source code for certain software that
enables users to view or otherwise access the Second Life virtual
world environment (the "Viewer Software"), under version 2 of the GNU
General Public License (the "GPL"). The creation or distribution of
works based on the Program (as defined under the GPL) of the Viewer
Software may require the use of certain Free/Libre and Open Source
Software ("FLOSS") works that are subject to license agreements not
compatible with re-licensing under the GPL. Because we want to allow
the Viewer Software to be distributed with these FLOSS works, this
FLOSS Exception following exception applies subject to the terms and
conditions below.
Legal Terms and Conditions
As a special exception to the terms and conditions of version 2.0 of
the GPL:
You are free to distribute a work based on the Program that is formed
entirely from the Viewer Software (and any modifications thereof) and
one or more works that are independent and separate works not derived
from the Viewer Software, and are licensed under one or more of the
licenses listed below in section 1 (each, a "FLOSS Work") , as long
as:
A. You obey the GPL in all respects for the Viewer Software and any
work based on the Program, except for the FLOSS Works, for which
you must comply with B below,
B. all FLOSS Works,
i. are distributed subject to one of the FLOSS licenses
listed below, and
ii. the object code or executable form of the FLOSS Works are
accompanied by the complete corresponding
machine-readable source code for those FLOSS Works on the
same medium and under the same FLOSS license as the
corresponding object code or executable forms thereof,
and
C. any works that are aggregated with the Viewer Software or a work
based on the Program on a volume of a storage or distribution
medium in accordance with the GPL, and are not licensed under
the FLOSS licenses listed below, are independent and separate
works in themselves which are not derivatives of either the
Viewer Software, a work based on the Program or a FLOSS Work.
If the above conditions are not met, then the Viewer Software may only
be copied, modified, distributed or used under the terms and
conditions of the GPL or another valid licensing option from Linden
Lab.
1. FLOSS License List
License name Version(s)/Copyright Date
Academic Free License 2.0
Apache Software License 1.0/1.1/2.0
Apple Public Source License 2.0
Artistic license From Perl 5.8.0
BSD license "July 22 1999"
Common Development and
Distribution License (CDDL) 1.0
Common Public License 1.0
GNU Library or "Lesser" General
Public License (LGPL) 2.0/2.1
Jabber Open Source License 1.0
MIT License (As listed in file MIT-License.txt) -
Mozilla Public License (MPL) 1.0/1.1
Open Software License 2.0
OpenSSL license (with
original SSLeay license) "2003" ("1998")
PHP License 3.0
Python license (CNRI Python License) -
Python Software Foundation License 2.1.1
Sleepycat License "1999"
W3C License "2001"
X11 License "2001"
Zlib/libpng License -
Zope Public License 2.0
Due to the many variants of some of the above licenses, we require
that any variant of the above licenses be identical in substance to
the form approved by the Open Source Initiative and follow the 2003
version of the Free Software Foundation's Free Software Definition
(http://www.gnu.org/philosophy/free-sw.html) or version 1.9 of the
Open Source Definition by the Open Source Initiative
(http://www.opensource.org/docs/definition.php).
2. Definitions
Terms used, but not defined, herein shall have the meaning provided in
the GPL.
3. Applicability
This FLOSS Exception applies to all Viewer Software files that contain
a notice placed by Linden Lab saying that the Viewer Software may be
distributed under the terms of this FLOSS Exception. If you create or
distribute a work which is a work based on the Program for the Viewer
Software and any other work licensed under the GPL, then this FLOSS
Exception is not available for that work; thus, you must remove the
FLOSS Exception notice from that work and comply with the GPL in all
respects, including by retaining all GPL notices. You may choose to
redistribute a copy of the Viewer Software exclusively under the terms
of the GPL by removing the FLOSS Exception notice from that copy of
the Viewer Software, provided that the copy has never been modified by
you or any third party.

View File

@@ -1,339 +0,0 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
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 Program or any portion
of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
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 Program, 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 Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) 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; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, 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 executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or 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 counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program 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.
5. 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 Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. 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 Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program 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 Program.
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.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program 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.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies 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 Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, 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
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. 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 PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
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 program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that 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.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

View File

@@ -1,36 +0,0 @@
Source code
========
The license for the source code in this distribution should be clearly
marked on each source file. Unless otherwise specified, the source
code in this distribution ("Source Code") is provided by Linden Lab to
you under the terms of the GNU General Public License, version 2.0
("GPL"), unless you have obtained a separate licensing agreement
("Other License"), formally executed by you and Linden Lab. Terms of
the GPL can be found in GPL-license.txt in this distribution, or
online at http://secondlifegrid.net/technology-programs/license-virtual-world/viewerlicensing/gplv2
There are special exceptions to the terms and conditions of the GPL as
it is applied to this Source Code. View the full text of the exception
in the file FLOSS-exception.txt in this software distribution, or
online at http://secondlifegrid.net/technology-programs/license-virtual-world/viewerlicensing/flossexception
By copying, modifying or distributing this software, you acknowledge
that you have read and understood your obligations described above,
and agree to abide by those obligations.
ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
COMPLETENESS OR PERFORMANCE.
Logos and trademarks
==============
"Second Life" and "Linden Lab" are registered trademarks of Linden
Research, Inc. Other trademarks include (but are not limited to): the
names Linden and Linden Research, as well as the Linden Lab Hexagon
Design and the Second Life Hand Design logos.
Use of logos and trademarks are subject to the Linden Lab trademark
policy, available at:
http://secondlife.com/corporate/trademark/

23
LICENSES/boost.txt Normal file
View File

@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

550
LICENSES/dbusglib.txt Normal file
View File

@@ -0,0 +1,550 @@
The D-Bus glib bindings are licensed to you under your choice of the Academic
Free License version 2.1, or the GNU General Public License version 2. Both
licenses are included here. Some of the standalone binaries are under the GPL
only; in particular, but not limted to, tests/decode-gcov.c. Each source code
file is marked with the proper copyright information.
The Academic Free License
v. 2.1
This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following notice immediately following the copyright notice for the Original Work:
Licensed under the Academic Free License version 2.1
1) Grant of Copyright License. Licensor hereby grants You a
world-wide, royalty-free, non-exclusive, perpetual, sublicenseable
license to do the following:
a) to reproduce the Original Work in copies;
b) to prepare derivative works ("Derivative Works") based upon the Original Work;
c) to distribute copies of the Original Work and Derivative Works to the public;
d) to perform the Original Work publicly; and
e) to display the Original Work publicly.
2) Grant of Patent License. Licensor hereby grants You a world-wide,
royalty-free, non-exclusive, perpetual, sublicenseable license, under
patent claims owned or controlled by the Licensor that are embodied in
the Original Work as furnished by the Licensor, to make, use, sell and
offer for sale the Original Work and Derivative Works.
3) Grant of Source Code License. The term "Source Code" means the
preferred form of the Original Work for making modifications to it and
all available documentation describing how to modify the Original
Work. Licensor hereby agrees to provide a machine-readable copy of the
Source Code of the Original Work along with each copy of the Original
Work that Licensor distributes. Licensor reserves the right to satisfy
this obligation by placing a machine-readable copy of the Source Code
in an information repository reasonably calculated to permit
inexpensive and convenient access by You for as long as Licensor
continues to distribute the Original Work, and by publishing the
address of that information repository in a notice immediately
following the copyright notice that applies to the Original Work.
4) Exclusions From License Grant. Neither the names of Licensor, nor
the names of any contributors to the Original Work, nor any of their
trademarks or service marks, may be used to endorse or promote
products derived from this Original Work without express prior written
permission of the Licensor. Nothing in this License shall be deemed to
grant any rights to trademarks, copyrights, patents, trade secrets or
any other intellectual property of Licensor except as expressly stated
herein. No patent license is granted to make, use, sell or offer to
sell embodiments of any patent claims other than the licensed claims
defined in Section 2. No right is granted to the trademarks of
Licensor even if such marks are included in the Original Work. Nothing
in this License shall be interpreted to prohibit Licensor from
licensing under different terms from this License any Original Work
that Licensor otherwise would have a right to license.
5) This section intentionally omitted.
6) Attribution Rights. You must retain, in the Source Code of any
Derivative Works that You create, all copyright, patent or trademark
notices from the Source Code of the Original Work, as well as any
notices of licensing and any descriptive text identified therein as an
"Attribution Notice." You must cause the Source Code for any
Derivative Works that You create to carry a prominent Attribution
Notice reasonably calculated to inform recipients that You have
modified the Original Work.
7) Warranty of Provenance and Disclaimer of Warranty. Licensor
warrants that the copyright in and to the Original Work and the patent
rights granted herein by Licensor are owned by the Licensor or are
sublicensed to You under the terms of this License with the permission
of the contributor(s) of those copyrights and patent rights. Except as
expressly stated in the immediately proceeding sentence, the Original
Work is provided under this License on an "AS IS" BASIS and WITHOUT
WARRANTY, either express or implied, including, without limitation,
the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL
WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential
part of this License. No license to Original Work is granted hereunder
except under this disclaimer.
8) Limitation of Liability. Under no circumstances and under no legal
theory, whether in tort (including negligence), contract, or
otherwise, shall the Licensor be liable to any person for any direct,
indirect, special, incidental, or consequential damages of any
character arising as a result of this License or the use of the
Original Work including, without limitation, damages for loss of
goodwill, work stoppage, computer failure or malfunction, or any and
all other commercial damages or losses. This limitation of liability
shall not apply to liability for death or personal injury resulting
from Licensor's negligence to the extent applicable law prohibits such
limitation. Some jurisdictions do not allow the exclusion or
limitation of incidental or consequential damages, so this exclusion
and limitation may not apply to You.
9) Acceptance and Termination. If You distribute copies of the
Original Work or a Derivative Work, You must make a reasonable effort
under the circumstances to obtain the express assent of recipients to
the terms of this License. Nothing else but this License (or another
written agreement between Licensor and You) grants You permission to
create Derivative Works based upon the Original Work or to exercise
any of the rights granted in Section 1 herein, and any attempt to do
so except under the terms of this License (or another written
agreement between Licensor and You) is expressly prohibited by
U.S. copyright law, the equivalent laws of other countries, and by
international treaty. Therefore, by exercising any of the rights
granted to You in Section 1 herein, You indicate Your acceptance of
this License and all of its terms and conditions.
10) Termination for Patent Action. This License shall terminate
automatically and You may no longer exercise any of the rights granted
to You by this License as of the date You commence an action,
including a cross-claim or counterclaim, against Licensor or any
licensee alleging that the Original Work infringes a patent. This
termination provision shall not apply for an action alleging patent
infringement by combinations of the Original Work with other software
or hardware.
11) Jurisdiction, Venue and Governing Law. Any action or suit relating
to this License may be brought only in the courts of a jurisdiction
wherein the Licensor resides or in which Licensor conducts its primary
business, and under the laws of that jurisdiction excluding its
conflict-of-law provisions. The application of the United Nations
Convention on Contracts for the International Sale of Goods is
expressly excluded. Any use of the Original Work outside the scope of
this License or after its termination shall be subject to the
requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101
et seq., the equivalent laws of other countries, and international
treaty. This section shall survive the termination of this License.
12) Attorneys Fees. In any action to enforce the terms of this License
or seeking damages relating thereto, the prevailing party shall be
entitled to recover its costs and expenses, including, without
limitation, reasonable attorneys' fees and costs incurred in
connection with such action, including any appeal of such action. This
section shall survive the termination of this License.
13) Miscellaneous. This License represents the complete agreement
concerning the subject matter hereof. If any provision of this License
is held to be unenforceable, such provision shall be reformed only to
the extent necessary to make it enforceable.
14) Definition of "You" in This License. "You" throughout this
License, whether in upper or lower case, means an individual or a
legal entity exercising rights under, and complying with all of the
terms of, this License. For legal entities, "You" includes any entity
that controls, is controlled by, or is under common control with
you. For purposes of this definition, "control" means (i) the power,
direct or indirect, to cause the direction or management of such
entity, whether by contract or otherwise, or (ii) ownership of fifty
percent (50%) or more of the outstanding shares, or (iii) beneficial
ownership of such entity.
15) Right to Use. You may use the Original Work in all ways not
otherwise restricted or conditioned by this License or by law, and
Licensor promises not to interfere with or be responsible for such
uses by You.
This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights
reserved. Permission is hereby granted to copy and distribute this
license without modification. This license may not be modified without
the express written permission of its copyright owner.
--
END OF ACADEMIC FREE LICENSE. The following is intended to describe the essential
differences between the Academic Free License (AFL) version 1.0 and other
open source licenses:
The Academic Free License is similar to the BSD, MIT, UoI/NCSA and Apache
licenses in many respects but it is intended to solve a few problems with
those licenses.
* The AFL is written so as to make it clear what software is being
licensed (by the inclusion of a statement following the copyright notice
in the software). This way, the license functions better than a template
license. The BSD, MIT and UoI/NCSA licenses apply to unidentified software.
* The AFL contains a complete copyright grant to the software. The BSD
and Apache licenses are vague and incomplete in that respect.
* The AFL contains a complete patent grant to the software. The BSD, MIT,
UoI/NCSA and Apache licenses rely on an implied patent license and contain
no explicit patent grant.
* The AFL makes it clear that no trademark rights are granted to the
licensor's trademarks. The Apache license contains such a provision, but the
BSD, MIT and UoI/NCSA licenses do not.
* The AFL includes the warranty by the licensor that it either owns the
copyright or that it is distributing the software under a license. None of
the other licenses contain that warranty. All other warranties are disclaimed,
as is the case for the other licenses.
* The AFL is itself copyrighted (with the right granted to copy and distribute
without modification). This ensures that the owner of the copyright to the
license will control changes. The Apache license contains a copyright notice,
but the BSD, MIT and UoI/NCSA licenses do not.
--
START OF GNU GENERAL PUBLIC LICENSE
--
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
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 Program or any portion
of it, thus forming a work based on the Program, 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) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
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 Program, 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 Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) 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; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, 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 executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or 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 counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program 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.
5. 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 Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. 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 Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program 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 Program.
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.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program 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.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies 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 Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, 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
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. 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 PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
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 program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that 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
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.

19
LICENSES/elfio.txt Normal file
View File

@@ -0,0 +1,19 @@
ELFIO.h - ELF reader and producer.
Copyright (C) 2001 Serge Lamikhov-Center <to_serge@users.sourceforge.net>
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
The GNU Library GPL is available at http://www.gnu.org/copyleft/lesser.html

23
LICENSES/fontconfig.txt Normal file
View File

@@ -0,0 +1,23 @@
http://www.jclark.com/xml/copying.txt
Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd
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.

29
LICENSES/libxml.txt Normal file
View File

@@ -0,0 +1,29 @@
http://xmlsoft.org/
http://www.opensource.org/licenses/mit-license.html
Open Source Initiative OSI - The MIT License:Licensing
Tue, 2006-10-31 04:56 . nelson
The MIT License
Copyright (c) <year> <copyright holders>
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.

484
LICENSES/openal.txt Normal file
View File

@@ -0,0 +1,484 @@
GNU LIBRARY GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1991 Free Software Foundation, Inc.
675 Mass Ave, Cambridge, MA 02139, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the library GPL. It is
numbered 2 because it goes with version 2 of the ordinary GPL.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it. You can use it for
your libraries, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.
Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library. If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software. To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.
Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs. This
license, the GNU Library General Public License, applies to certain
designated libraries. This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.
The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it. Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program. However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.
Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries. We
concluded that weaker conditions might promote sharing better.
However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves. This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them. (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.) The hope is that this
will lead to faster development of free libraries.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, while the latter only
works together with the library.
Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
GNU LIBRARY GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License"). Each licensee is
addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
c) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
d) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<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 Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, 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!

View File

@@ -0,0 +1,5 @@
The pristine version of Qt corresponding to this build is available at:
http://viewer-source-downloads.s3.amazonaws.com/install_pkgs/qt-all-opensource-src-4.5.2.tar.bz2
The patches we applied to the above package to get this build are available at:
http://hg.secondlife.com/llqtwebkit/src/tip/qt_patches/

27
README
View File

@@ -9,30 +9,15 @@
Sin-gu-la-ri-ty (noun) - a distinctive feature, a uniqueness; a point at which Sin-gu-la-ri-ty (noun) - a distinctive feature, a uniqueness; a point at which
continuity breaks up; a point in history at which machine becomes smarter than continuity breaks up; a point in history at which machine becomes smarter than
humanity and/or fuses with it indivisively; or simply a cool sounding word with humanity and/or fuses with it indivisively; or simply a cool sounding word with
the initials S.G. in it :) my initials in it :)
Singularity Viewer is a SecondLife(tm) protocol compatible client application. Singularity Viewer is a Second Life protocol compatible client application. It
It can be used to access SecondLife services as well as a number of others such can be used to access Second LIfe service as well as a number of other such as
as those based upon the OpenSim platform. those based upon OpenSim plattform. It is directly based upon source code of
Ascent Viewer by Balseraph Software Group, which is in turn based upon source
Singulariy is maintained by a small group of volunteers who can be contacted code released by Linden Lab, with contributions from various sources.
both, in-world (SingularityViewer group) as well on IRC (#SingularityViewer
@ FreeNode). Bug requests and features requests can be submitted through our
Issue Tracker (http://code.google.com/p/singularity-viewer/issues/list or from
the viewer menu: Help --> Bug Reporting --> Singularity Issue Tracker...)
As this Readme grows out of date, please refer to As this Readme grows out of date, please refer to
http://www.singularityviewer.org/about http://www.singularityviewer.org/about
00000000011111111112222222222333333333344444444445555555555666666666677777777778
12345678901234567890123456789012345678901234567890123456789012345678901234567890
History
The Singularity viewer was started by Siana Gearz in November 2010 by forking it
from the Ascent Viewer, by Balseraph Software Group, which in turn was based upon
source code modified from the snowglobe source code released by Linden Lab.

View File

@@ -248,7 +248,6 @@ Celierra Darling
VWR-6975 VWR-6975
Cron Stardust Cron Stardust
VWR-10579 VWR-10579
STORM-1919
Cypren Christenson Cypren Christenson
SNOW-129 SNOW-129
SNOW-140 SNOW-140

View File

@@ -50,7 +50,7 @@
<key>OpenCircuit</key> <key>OpenCircuit</key>
<map> <map>
<key>flavor</key> <key>flavor</key>
<string>llsd</string> <string>template</string>
<key>trusted-sender</key> <key>trusted-sender</key>
<boolean>false</boolean> <boolean>false</boolean>
</map> </map>
@@ -370,22 +370,6 @@
</map> </map>
<!-- Server to client --> <!-- Server to client -->
<key>DisplayNameUpdate</key>
<map>
<key>flavor</key>
<string>llsd</string>
<key>trusted-sender</key>
<boolean>true</boolean>
</map>
<key>WindLightRefresh</key>
<map>
<key>flavor</key>
<string>llsd</string>
<key>trusted-sender</key>
<boolean>true</boolean>
</map>
<key>ParcelVoiceInfo</key> <key>ParcelVoiceInfo</key>
<map> <map>
<key>flavor</key> <key>flavor</key>
@@ -394,6 +378,14 @@
<boolean>true</boolean> <boolean>true</boolean>
</map> </map>
<key>ParcelMediaURLFilter</key>
<map>
<key>flavor</key>
<string>llsd</string>
<key>trusted-sender</key>
<boolean>false</boolean>
</map>
<key>ParcelNavigateMedia</key> <key>ParcelNavigateMedia</key>
<map> <map>
<key>flavor</key> <key>flavor</key>
@@ -434,22 +426,6 @@
<boolean>true</boolean> <boolean>true</boolean>
</map> </map>
<key>SetDisplayNameReply</key>
<map>
<key>flavor</key>
<string>llsd</string>
<key>trusted-sender</key>
<boolean>true</boolean>
</map>
<key>SimConsoleResponse</key>
<map>
<key>flavor</key>
<string>llsd</string>
<key>trusted-sender</key>
<boolean>true</boolean>
</map>
<key>DirLandReply</key> <key>DirLandReply</key>
<map> <map>
<key>flavor</key> <key>flavor</key>
@@ -546,24 +522,8 @@
<key>trusted-sender</key> <key>trusted-sender</key>
<boolean>true</boolean> <boolean>true</boolean>
</map> </map>
<key>NavMeshStatusUpdate</key> <!-- UDPDeprecated Messages -->
<map>
<key>flavor</key>
<string>llsd</string>
<key>trusted-sender</key>
<boolean>true</boolean>
</map>
<key>AgentStateUpdate</key>
<map>
<key>flavor</key>
<string>llsd</string>
<key>trusted-sender</key>
<boolean>true</boolean>
</map>
<!-- UDPDeprecated Messages -->
<key>ScriptRunningReply</key> <key>ScriptRunningReply</key>
<map> <map>
<key>flavor</key> <key>flavor</key>
@@ -612,13 +572,22 @@
<boolean>false</boolean> <boolean>false</boolean>
</map> </map>
<key>ObjectPhysicsProperties</key> <!-- Server to client -->
<map> <key>DisplayNameUpdate</key>
<key>flavor</key> <map>
<string>llsd</string> <key>flavor</key>
<key>trusted-sender</key> <string>llsd</string>
<boolean>true</boolean> <key>trusted-sender</key>
</map> <boolean>true</boolean>
</map>
<key>SetDisplayNameReply</key>
<map>
<key>flavor</key>
<string>llsd</string>
<key>trusted-sender</key>
<boolean>true</boolean>
</map>
</map> </map>
<key>capBans</key> <key>capBans</key>
@@ -663,7 +632,7 @@
<boolean>false</boolean> <boolean>false</boolean>
<key>RequestTextureDownload</key> <key>RequestTextureDownload</key>
<boolean>true</boolean> <boolean>false</boolean>
<key>EventQueueGet</key> <key>EventQueueGet</key>
<boolean>false</boolean> <boolean>false</boolean>
@@ -701,22 +670,19 @@
<key>EstateChangeInfo</key> <key>EstateChangeInfo</key>
<boolean>true</boolean> <boolean>true</boolean>
<key>FetchInventoryDescendents2</key> <key>FetchInventoryDescendents</key>
<boolean>false</boolean> <boolean>false</boolean>
<key>WebFetchInventoryDescendents</key> <key>WebFetchInventoryDescendents</key>
<boolean>false</boolean> <boolean>false</boolean>
<key>FetchInventory2</key> <key>FetchInventory</key>
<boolean>true</boolean> <boolean>true</boolean>
<key>FetchLibDescendents2</key> <key>FetchLibDescendents</key>
<boolean>true</boolean> <boolean>true</boolean>
<key>FetchLib2</key> <key>FetchLib</key>
<boolean>true</boolean>
<key>UploadBakedTexture</key>
<boolean>true</boolean> <boolean>true</boolean>
</map> </map>

View File

@@ -18,7 +18,7 @@ cmake_minimum_required(VERSION 2.6.2 FATAL_ERROR)
cmake_policy(SET CMP0003 OLD) cmake_policy(SET CMP0003 OLD)
set(ROOT_PROJECT_NAME "Singularity" CACHE STRING set(ROOT_PROJECT_NAME "Singularity" CACHE STRING
"The root project/makefile/solution name. Defaults to Singularity.") "The root project/makefile/solution name. Defaults to SecondLife.")
project(${ROOT_PROJECT_NAME}) project(${ROOT_PROJECT_NAME})
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
@@ -26,15 +26,15 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(Variables) include(Variables)
# Load versions now. Install locations need them. # Load versions now. Install locations need them.
include(BuildVersion) include(Versions)
include(UnixInstall) include(UnixInstall)
set (DISABLE_FATAL_WARNINGS TRUE) set (GCC_DISABLE_FATAL_WARNINGS TRUE)
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING set(CMAKE_BUILD_TYPE ReleaseSSE2 CACHE STRING
"Build type. One of: Debug Release RelWithDebInfo" FORCE) "Build type. One of: Debug Release ReleaseSSE2 RelWithDebInfo" FORCE)
endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
# Create a 'prepare' target in which to perform setup actions. This # Create a 'prepare' target in which to perform setup actions. This
@@ -46,9 +46,8 @@ endif(NOT STANDALONE)
add_custom_target(prepare DEPENDS ${prepare_depends}) add_custom_target(prepare DEPENDS ${prepare_depends})
add_subdirectory(cmake) add_subdirectory(cmake)
add_subdirectory(${LIBS_OPEN_PREFIX}aistatemachine) add_subdirectory(${LIBS_OPEN_PREFIX}cwdebug)
add_subdirectory(${LIBS_OPEN_PREFIX}llaudio) add_subdirectory(${LIBS_OPEN_PREFIX}llaudio)
add_subdirectory(${LIBS_OPEN_PREFIX}llappearance)
add_subdirectory(${LIBS_OPEN_PREFIX}llcharacter) add_subdirectory(${LIBS_OPEN_PREFIX}llcharacter)
add_subdirectory(${LIBS_OPEN_PREFIX}llcommon) add_subdirectory(${LIBS_OPEN_PREFIX}llcommon)
add_subdirectory(${LIBS_OPEN_PREFIX}llimage) add_subdirectory(${LIBS_OPEN_PREFIX}llimage)
@@ -63,15 +62,11 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llvfs)
add_subdirectory(${LIBS_OPEN_PREFIX}llwindow) add_subdirectory(${LIBS_OPEN_PREFIX}llwindow)
add_subdirectory(${LIBS_OPEN_PREFIX}llxml) add_subdirectory(${LIBS_OPEN_PREFIX}llxml)
if(STANDALONE)
add_subdirectory(${LIBS_OPEN_PREFIX}llqtwebkit)
endif(STANDALONE)
if (EXISTS ${LIBS_CLOSED_DIR}llkdu AND NOT STANDALONE) if (EXISTS ${LIBS_CLOSED_DIR}llkdu AND NOT STANDALONE)
add_subdirectory(${LIBS_CLOSED_PREFIX}llkdu) add_subdirectory(${LIBS_CLOSED_PREFIX}llkdu)
endif (EXISTS ${LIBS_CLOSED_DIR}llkdu AND NOT STANDALONE) endif (EXISTS ${LIBS_CLOSED_DIR}llkdu AND NOT STANDALONE)
#add_subdirectory(${LIBS_OPEN_PREFIX}lscript) add_subdirectory(${LIBS_OPEN_PREFIX}lscript)
if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts) if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
add_subdirectory(${LIBS_CLOSED_PREFIX}copy_win_scripts) add_subdirectory(${LIBS_CLOSED_PREFIX}copy_win_scripts)

View File

@@ -1,39 +0,0 @@
# -*- cmake -*-
project(aistatemachine)
include(00-Common)
include(LLCommon)
include(LLMessage)
include(LLMath)
include(LLXML)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(
${LLCOMMON_INCLUDE_DIRS}
${LLMESSAGE_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS}
${LLXML_INCLUDE_DIRS}
)
set(aistatemachine_SOURCE_FILES
aistatemachine.cpp
aitimer.cpp
)
set(aistatemachine_HEADER_FILES
CMakeLists.txt
aistatemachine.h
aitimer.h
)
set_source_files_properties(${aistatemachine_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
list(APPEND aistatemachine_SOURCE_FILES ${aistatemachine_HEADER_FILES})
add_library (aistatemachine ${aistatemachine_SOURCE_FILES})
add_dependencies(aistatemachine prepare)

View File

@@ -1,628 +0,0 @@
/**
* @file aistatemachine.cpp
* @brief Implementation of AIStateMachine
*
* Copyright (c) 2010, Aleric Inglewood.
*
* 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, see <http://www.gnu.org/licenses/>.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution.
*
* CHANGELOG
* and additional copyright holders.
*
* 01/03/2010
* Initial version, written by Aleric Inglewood @ SL
*/
#include "linden_common.h"
#include <algorithm>
#include "llcontrol.h"
#include "llfasttimer.h"
#include "aithreadsafe.h"
#include "aistatemachine.h"
// Local variables.
namespace {
struct QueueElementComp;
class QueueElement {
private:
AIStateMachine* mStateMachine;
U64 mRuntime;
public:
QueueElement(AIStateMachine* statemachine) : mStateMachine(statemachine), mRuntime(0) { }
friend bool operator==(QueueElement const& e1, QueueElement const& e2) { return e1.mStateMachine == e2.mStateMachine; }
friend struct QueueElementComp;
AIStateMachine& statemachine(void) const { return *mStateMachine; }
void add(U64 count) { mRuntime += count; }
};
struct QueueElementComp {
bool operator()(QueueElement const& e1, QueueElement const& e2) const { return e1.mRuntime < e2.mRuntime; }
};
typedef std::vector<QueueElement> active_statemachines_type;
active_statemachines_type active_statemachines;
}
// static
U64 AIStateMachine::sMaxCount;
AIThreadSafeDC<AIStateMachine::csme_type> AIStateMachine::sContinuedStateMachinesAndMainloopEnabled;
// static
void AIStateMachine::setMaxCount(F32 StateMachineMaxTime)
{
llassert(is_main_thread());
Dout(dc::statemachine, "(Re)calculating AIStateMachine::sMaxCount");
sMaxCount = calc_clock_frequency() * StateMachineMaxTime / 1000;
}
//----------------------------------------------------------------------------
//
// Public methods
//
void AIStateMachine::run(AIStateMachine* parent, state_type new_parent_state, bool abort_parent, bool on_abort_signal_parent)
{
DoutEntering(dc::statemachine, "AIStateMachine::run(" << (void*)parent << ", " << (parent ? parent->state_str(new_parent_state) : "NA") << ", " << abort_parent << ") [" << (void*)this << "]");
// Must be the first time we're being run, or we must be called from a callback function.
llassert(!mParent || mState == bs_callback);
llassert(!mCallback || mState == bs_callback);
// Can only be run when in this state.
llassert(mState == bs_initialize || mState == bs_callback);
// Allow NULL to be passed as parent to signal that we want to reuse the old one.
if (parent)
{
mParent = parent;
// In that case remove any old callback!
if (mCallback)
{
delete mCallback;
mCallback = NULL;
}
mNewParentState = new_parent_state;
mAbortParent = abort_parent;
mOnAbortSignalParent = on_abort_signal_parent;
}
// If abort_parent is requested then a parent must be provided.
llassert(!abort_parent || mParent);
// If a parent is provided, it must be running.
llassert(!mParent || mParent->mState == bs_run);
// Mark that run() has been called, in case we're being called from a callback function.
mState = bs_initialize;
// Set mIdle to false and add statemachine to continued_statemachines.
mSetStateLock.lock();
locked_cont();
}
void AIStateMachine::run(callback_type::signal_type::slot_type const& slot)
{
DoutEntering(dc::statemachine, "AIStateMachine::run(<slot>) [" << (void*)this << "]");
// Must be the first time we're being run, or we must be called from a callback function.
llassert(!mParent || mState == bs_callback);
llassert(!mCallback || mState == bs_callback);
// Can only be run when in this state.
llassert(mState == bs_initialize || mState == bs_callback);
// Clean up any old callbacks.
mParent = NULL;
if (mCallback)
{
delete mCallback;
mCallback = NULL;
}
mCallback = new callback_type(slot);
// Mark that run() has been called, in case we're being called from a callback function.
mState = bs_initialize;
// Set mIdle to false and add statemachine to continued_statemachines.
mSetStateLock.lock();
locked_cont();
}
void AIStateMachine::idle(void)
{
DoutEntering(dc::statemachine, "AIStateMachine::idle() [" << (void*)this << "]");
llassert(is_main_thread());
llassert(!mIdle);
mIdle = true;
mSleep = 0;
#ifdef SHOW_ASSERT
mCalledThreadUnsafeIdle = true;
#endif
}
void AIStateMachine::idle(state_type current_run_state)
{
DoutEntering(dc::statemachine, "AIStateMachine::idle(" << state_str(current_run_state) << ") [" << (void*)this << "]");
llassert(is_main_thread());
llassert(!mIdle);
mSetStateLock.lock();
// Only go idle if the run state is (still) what we expect it to be.
// Otherwise assume that another thread called set_state() and continue running.
if (current_run_state == mRunState)
{
mIdle = true;
mSleep = 0;
}
mSetStateLock.unlock();
}
// About thread safeness:
//
// The main thread initializes a statemachine and calls run, so a statemachine
// runs in the main thread. However, it is allowed that a state calls idle()
// and then allows one or more other threads to call cont() upon some
// event (only once, of course, as idle() has to be called before cont()
// can be called again-- and a non-main thread is not allowed to call idle()).
// Instead of cont() one may also call set_state().
// Of course, this may give rise to a race condition; if that happens then
// the thread that calls cont() (set_state()) first is serviced, and the other
// thread(s) are ignored, as if they never called cont().
void AIStateMachine::locked_cont(void)
{
DoutEntering(dc::statemachine, "AIStateMachine::locked_cont() [" << (void*)this << "]");
llassert(mIdle);
// Atomic test mActive and change mIdle.
mIdleActive.lock();
#ifdef SHOW_ASSERT
mContThread.reset();
#endif
mIdle = false;
bool not_active = mActive == as_idle;
mIdleActive.unlock();
// mActive is only changed in AIStateMachine::mainloop, by the main-thread, and
// here, possibly by any thread. However, after setting mIdle to false above, it
// is impossible for any thread to come here, until after the main-thread called
// idle(). So, if this is the main thread then that certainly isn't going to
// happen until we left this function, while if this is another thread and the
// state machine is already running in the main thread then not_active is false
// and we're already at the end of this function.
// If not_active is true then main-thread is not running this statemachine.
// It might call cont() (or set_state()) but never locked_cont(), and will never
// start actually running until we are done here and release the lock on
// sContinuedStateMachinesAndMainloopEnabled again. It is therefore safe
// to release mSetStateLock here, with as advantage that if we're not the main-
// thread and not_active is true, then the main-thread won't block when it has
// a timer running that times out and calls set_state().
mSetStateLock.unlock();
if (not_active)
{
AIWriteAccess<csme_type> csme_w(sContinuedStateMachinesAndMainloopEnabled);
// See above: it is not possible that mActive was changed since not_active
// was set to true above.
llassert_always(mActive == as_idle);
Dout(dc::statemachine, "Adding " << (void*)this << " to continued_statemachines");
csme_w->continued_statemachines.push_back(this);
if (!csme_w->mainloop_enabled)
{
Dout(dc::statemachine, "Activating AIStateMachine::mainloop.");
csme_w->mainloop_enabled = true;
}
mActive = as_queued;
llassert_always(!mIdle); // It should never happen that the main thread calls idle(), while another thread calls cont() concurrently.
}
}
void AIStateMachine::set_state(state_type state)
{
DoutEntering(dc::statemachine, "AIStateMachine::set_state(" << state_str(state) << ") [" << (void*)this << "]");
// Stop race condition of multiple threads calling cont() or set_state() here.
mSetStateLock.lock();
// Do not call set_state() unless running.
llassert(mState == bs_run || !is_main_thread());
// If this function is called from another thread than the main thread, then we have to ignore
// it if we're not idle and the state is less than the current state. The main thread must
// be able to change the state to anything (also smaller values). Note that that only can work
// if the main thread itself at all times cancels thread callbacks that call set_state()
// before calling idle() again!
//
// Thus: main thead calls idle(), and tells one or more threads to do callbacks on events,
// which (might) call set_state(). If the main thread calls set_state first (currently only
// possible as a result of the use of a timer) it will set mIdle to false (here) then cancel
// the call backs from the other threads and only then call idle() again.
// Thus if you want other threads get here while mIdle is false to be ignored then the
// main thread should use a large value for the new run state.
//
// If a non-main thread calls set_state first, then the state is changed but the main thread
// can still override it if it calls set_state before handling the new state; in the latter
// case it would still be as if the call from the non-main thread was ignored.
//
// Concurrent calls from non-main threads however, always result in the largest state
// to prevail.
// If the state machine is already running, and we are not the main-thread and the new
// state is less than the current state, ignore it.
// Also, if abort() or finish() was called, then we should just ignore it.
if (mState != bs_run ||
(!mIdle && state <= mRunState && !AIThreadID::in_main_thread()))
{
#ifdef SHOW_ASSERT
// It's a bit weird if the same thread does two calls on a row where the second call
// has a smaller value: warn about that.
if (mState == bs_run && mContThread.equals_current_thread())
{
llwarns << "Ignoring call to set_state(" << state_str(state) <<
") by non-main thread before main-thread could react on previous call, "
"because new state is smaller than old state (" << state_str(mRunState) << ")." << llendl;
}
#endif
mSetStateLock.unlock();
return; // Ignore.
}
// Do not call idle() when set_state is called from another thread; use idle(state_type) instead.
llassert(!mCalledThreadUnsafeIdle || is_main_thread());
// Change mRunState to the requested value.
if (mRunState != state)
{
mRunState = state;
Dout(dc::statemachine, "mRunState set to " << state_str(mRunState));
}
// Continue the state machine if appropriate.
if (mIdle)
locked_cont(); // This unlocks mSetStateLock.
else
mSetStateLock.unlock();
// If we get here then mIdle is false, so only mRunState can still be changed but we won't
// call locked_cont() anymore. When the main thread finally picks up on the state change,
// it will cancel any possible callbacks from other threads and process the largest state
// that this function was called with in the meantime.
}
void AIStateMachine::abort(void)
{
DoutEntering(dc::statemachine, "AIStateMachine::abort() [" << (void*)this << "]");
// It's possible that abort() is called before calling AIStateMachine::multiplex.
// In that case the statemachine wasn't initialized yet and we should just kill() it.
if (LL_UNLIKELY(mState == bs_initialize))
{
// It's ok to use the thread-unsafe idle() here, because if the statemachine
// wasn't started yet, then other threads won't call set_state() on it.
if (!mIdle)
idle();
// run() calls locked_cont() after which the top of the mainloop adds this
// state machine to active_statemachines. Therefore, if the following fails
// then either the same statemachine called run() immediately followed by abort(),
// which is not allowed; or there were two active statemachines running,
// the first created a new statemachine and called run() on it, and then
// the other (before reaching the top of the mainloop) called abort() on
// that freshly created statemachine. Obviously, this is highly unlikely,
// but if that is the case then here we bump the statemachine into
// continued_statemachines to prevent kill() to delete this statemachine:
// the caller of abort() does not expect that.
if (LL_UNLIKELY(mActive == as_idle))
{
mSetStateLock.lock();
locked_cont();
idle();
}
kill();
}
else
{
llassert(mState == bs_run);
mSetStateLock.lock();
mState = bs_abort; // Causes additional calls to set_state to be ignored.
mSetStateLock.unlock();
abort_impl();
mAborted = true;
finish();
}
}
void AIStateMachine::finish(void)
{
DoutEntering(dc::statemachine, "AIStateMachine::finish() [" << (void*)this << "]");
mSetStateLock.lock();
llassert(mState == bs_run || mState == bs_abort);
// It is possible that mIdle is true when abort or finish was called from
// outside multiplex_impl. However, that only may be done by the main thread.
llassert(!mIdle || is_main_thread());
if (!mIdle)
idle(); // After calling this, we don't want other threads to call set_state() anymore.
mState = bs_finish; // Causes additional calls to set_state to be ignored.
mSetStateLock.unlock();
finish_impl();
// Did finish_impl call kill()? Then that is only the default. Remember it.
bool default_delete = (mState == bs_killed);
mState = bs_finish;
if (mParent)
{
// It is possible that the parent is not running when the parent is in fact aborting and called
// abort on this object from it's abort_impl function. It that case we don't want to recursively
// call abort again (or change it's state).
if (mParent->running())
{
if (mAborted && mAbortParent)
{
mParent->abort();
mParent = NULL;
}
else if (!mAborted || mOnAbortSignalParent)
{
mParent->set_state(mNewParentState);
}
}
}
// After this (bool)*this evaluates to true and we can call the callback, which then is allowed to call run().
mState = bs_callback;
if (mCallback)
{
// This can/may call kill() that sets mState to bs_kill and in which case the whole AIStateMachine
// will be deleted from the mainloop, or it may call run() that sets mState is set to bs_initialize
// and might change or reuse mCallback or mParent.
mCallback->callback(!mAborted);
if (mState != bs_initialize)
{
delete mCallback;
mCallback = NULL;
mParent = NULL;
}
}
else
{
// Not restarted by callback. Allow run() to be called later on.
mParent = NULL;
}
// Fix the final state.
if (mState == bs_callback)
mState = default_delete ? bs_killed : bs_initialize;
if (mState == bs_killed && mActive == as_idle)
{
// Bump the statemachine onto the active statemachine list, or else it won't be deleted.
mSetStateLock.lock();
locked_cont();
idle();
}
}
void AIStateMachine::kill(void)
{
DoutEntering(dc::statemachine, "AIStateMachine::kill() [" << (void*)this << "]");
// Should only be called from finish() (or when not running (bs_initialize)).
// However, also allow multiple calls to kill() on a row (bs_killed) (which effectively don't do anything).
llassert(mIdle && (mState == bs_callback || mState == bs_finish || mState == bs_initialize || mState == bs_killed));
base_state_type prev_state = mState;
mState = bs_killed;
if (prev_state == bs_initialize && mActive == as_idle)
{
// We're not running (ie being deleted by a parent statemachine), delete it immediately.
delete this;
}
}
// Return stringified 'state'.
char const* AIStateMachine::state_str(state_type state)
{
if (state >= min_state && state < max_state)
{
switch (state)
{
AI_CASE_RETURN(bs_initialize);
AI_CASE_RETURN(bs_run);
AI_CASE_RETURN(bs_abort);
AI_CASE_RETURN(bs_finish);
AI_CASE_RETURN(bs_callback);
AI_CASE_RETURN(bs_killed);
}
}
return state_str_impl(state);
}
//----------------------------------------------------------------------------
//
// Private methods
//
void AIStateMachine::multiplex(U64 current_time)
{
// Return immediately when this state machine is sleeping.
// A negative value of mSleep means we're counting frames,
// a positive value means we're waiting till a certain
// amount of time has passed.
if (mSleep != 0)
{
if (mSleep < 0)
{
if (++mSleep)
return;
}
else
{
if (current_time < (U64)mSleep)
return;
mSleep = 0;
}
}
DoutEntering(dc::statemachine, "AIStateMachine::multiplex() [" << (void*)this << "] [with state: " << state_str(mState == bs_run ? mRunState : mState) << "]");
llassert(mState == bs_initialize || mState == bs_run);
// Real state machine starts here.
if (mState == bs_initialize)
{
mAborted = false;
mState = bs_run;
initialize_impl();
if (mAborted || mState != bs_run)
return;
}
multiplex_impl();
}
//static
void AIStateMachine::add_continued_statemachines(AIReadAccess<csme_type>& csme_r)
{
bool nonempty = false;
for (continued_statemachines_type::const_iterator iter = csme_r->continued_statemachines.begin(); iter != csme_r->continued_statemachines.end(); ++iter)
{
nonempty = true;
active_statemachines.push_back(QueueElement(*iter));
Dout(dc::statemachine, "Adding " << (void*)*iter << " to active_statemachines");
(*iter)->mActive = as_active;
}
if (nonempty)
AIWriteAccess<csme_type>(csme_r)->continued_statemachines.clear();
}
// static
void AIStateMachine::dowork(void)
{
llassert(!active_statemachines.empty());
// Run one or more state machines.
U64 total_clocks = 0;
for (active_statemachines_type::iterator iter = active_statemachines.begin(); iter != active_statemachines.end(); ++iter)
{
AIStateMachine& statemachine(iter->statemachine());
if (!statemachine.mIdle)
{
U64 start = get_clock_count();
// This might call idle() and then pass the statemachine to another thread who then may call cont().
// Hence, after this isn't not sure what mIdle is, and it can change from true to false at any moment,
// if it is true after this function returns.
statemachine.multiplex(start);
U64 delta = get_clock_count() - start;
iter->add(delta);
total_clocks += delta;
if (total_clocks >= sMaxCount)
{
#ifndef LL_RELEASE_FOR_DOWNLOAD
llwarns << "AIStateMachine::mainloop did run for " << (total_clocks * 1000 / calc_clock_frequency()) << " ms." << llendl;
#endif
std::sort(active_statemachines.begin(), active_statemachines.end(), QueueElementComp());
break;
}
}
}
// Remove idle state machines from the loop.
active_statemachines_type::iterator iter = active_statemachines.begin();
while (iter != active_statemachines.end())
{
AIStateMachine& statemachine(iter->statemachine());
// Atomic test mIdle and change mActive.
bool locked = statemachine.mIdleActive.tryLock();
// If the lock failed, then another thread is in the middle of calling cont(),
// thus mIdle will end up false. So, there is no reason to block here; just
// treat mIdle as false already.
if (locked && statemachine.mIdle)
{
// Without the lock, it would be possible that another thread called cont() right here,
// changing mIdle to false again but NOT adding the statemachine to continued_statemachines,
// thinking it is in active_statemachines (and it is), while immediately below it is
// erased from active_statemachines.
statemachine.mActive = as_idle;
// Now, calling cont() is ok -- as that will cause the statemachine to be added to
// continued_statemachines, so it's fine in that case-- even necessary-- to remove it from
// active_statemachines regardless, and we can release the lock here.
statemachine.mIdleActive.unlock();
Dout(dc::statemachine, "Erasing " << (void*)&statemachine << " from active_statemachines");
iter = active_statemachines.erase(iter);
if (statemachine.mState == bs_killed)
{
Dout(dc::statemachine, "Deleting " << (void*)&statemachine);
delete &statemachine;
}
}
else
{
if (locked)
{
statemachine.mIdleActive.unlock();
}
llassert(statemachine.mActive == as_active); // It should not be possible that another thread called cont() and changed this when we are we are not idle.
llassert(statemachine.mState == bs_run || statemachine.mState == bs_initialize);
++iter;
}
}
if (active_statemachines.empty())
{
// If this was the last state machine, remove mainloop from the IdleCallbacks.
AIReadAccess<csme_type> csme_r(sContinuedStateMachinesAndMainloopEnabled, true);
if (csme_r->continued_statemachines.empty() && csme_r->mainloop_enabled)
{
Dout(dc::statemachine, "Deactivating AIStateMachine::mainloop: no active state machines left.");
AIWriteAccess<csme_type>(csme_r)->mainloop_enabled = false;
}
}
}
// static
void AIStateMachine::flush(void)
{
DoutEntering(dc::curl, "AIStateMachine::flush(void)");
{
AIReadAccess<csme_type> csme_r(sContinuedStateMachinesAndMainloopEnabled);
add_continued_statemachines(csme_r);
}
// Abort all state machines.
for (active_statemachines_type::iterator iter = active_statemachines.begin(); iter != active_statemachines.end(); ++iter)
{
AIStateMachine& statemachine(iter->statemachine());
if (statemachine.abortable())
{
// We can't safely call abort() here for non-running (run() was called, but they weren't initialized yet) statemachines,
// because that might call kill() which in some cases is undesirable (ie, when it is owned by a partent that will
// also call abort() on it when it is aborted itself).
if (statemachine.running())
statemachine.abort();
else
statemachine.idle(); // Stop the statemachine from starting, in the next loop with batch == 0.
}
}
for (int batch = 0;; ++batch)
{
// Run mainloop until all state machines are idle (batch == 0) or deleted (batch == 1).
for(;;)
{
{
AIReadAccess<csme_type> csme_r(sContinuedStateMachinesAndMainloopEnabled);
if (!csme_r->mainloop_enabled)
break;
}
mainloop();
}
if (batch == 1)
break;
{
AIReadAccess<csme_type> csme_r(sContinuedStateMachinesAndMainloopEnabled);
add_continued_statemachines(csme_r);
}
}
// At this point all statemachines should be idle.
AIReadAccess<csme_type> csme_r(sContinuedStateMachinesAndMainloopEnabled);
llinfos << "Current number of continued statemachines: " << csme_r->continued_statemachines.size() << llendl;
llinfos << "Current number of active statemachines: " << active_statemachines.size() << llendl;
llassert(csme_r->continued_statemachines.empty() && active_statemachines.empty());
}

View File

@@ -1,422 +0,0 @@
/**
* @file aistatemachine.h
* @brief State machine base class
*
* Copyright (c) 2010, Aleric Inglewood.
*
* 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, see <http://www.gnu.org/licenses/>.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution.
*
* CHANGELOG
* and additional copyright holders.
*
* 01/03/2010
* Initial version, written by Aleric Inglewood @ SL
*/
#ifndef AISTATEMACHINE_H
#define AISTATEMACHINE_H
#include "aithreadsafe.h"
#include "lltimer.h"
#include <boost/signals2.hpp>
//!
// A AIStateMachine is a base class that allows derived classes to
// go through asynchronous states, while the code still appears to
// be more or less sequential.
//
// These state machine objects can be reused to build more complex
// objects.
//
// It is important to note that each state has a duality: the object
// can have a state that will cause a corresponding function to be
// called; and often that function will end with changing the state
// again, to signal that it was handled. It is easy to confuse the
// function of a state with the state at the end of the function.
// For example, the state "initialize" could cause the member
// function 'init()' to be called, and at the end one would be
// inclined to set the state to "initialized". However, this is the
// wrong approach: the correct use of state names does reflect the
// functions that will be called, never the function that just was
// called.
//
// Each (derived) class goes through a series of states as follows:
//
// Creation
// |
// v
// (idle) <----. Idle until run() is called.
// | |
// Initialize | Calls initialize_impl().
// | |
// | (idle) | Idle until cont() or set_state() is called.
// | | ^ |
// v v | |
// .-------. | |
// | Run |_, | Call multiplex_impl() until idle(), abort() or finish() is called.
// '-------' |
// | | |
// v | |
// Abort | | Calls abort_impl().
// | | |
// v v |
// Finish | Calls finish_impl() (which may call kill()) or
// | | | the callback function passed to run(), if any,
// | v |
// | Callback | which may call kill() and/or run().
// | | | |
// | | `-----'
// v v
// Killed Delete the statemachine (all statemachines must be allocated with new).
//
// Each state causes corresponding code to be called.
// Finish cleans up whatever is done by Initialize.
// Abort should clean up additional things done by Run.
//
// The Run state is entered by calling run().
//
// While the base class is in the Run state, it is the derived class
// that goes through different states. The state variable of the derived
// class is only valid while the base class is in the state Run.
//
// A derived class can exit the Run state by calling one of two methods:
// abort() in case of failure, or finish() in case of success.
// Respectively these set the state to Abort and Finish.
//
// finish_impl may call kill() for a (default) destruction upon finish.
// Even in that case the callback (passed to run()) may call run() again,
// which overrides the request for a default kill. Or, if finish_impl
// doesn't call kill() the callback may call kill() to request the
// destruction of the state machine object.
//
// State machines are run from the "idle" part of the viewer main loop.
// Often a state machine has nothing to do however. In that case it can
// call the method idle(). This will stop the state machine until
// external code changes it's state (by calling set_state()), or calls
// cont() to continue with the last state.
//
// The methods of the derived class call set_state() to change their
// own state within the bs_run state, or by calling either abort()
// or finish().
//
// Restarting a finished state machine can also be done by calling run(),
// which will cause a re-initialize.
//
// Derived classes should implement the following constants:
//
// static state_type const min_state = first_state;
// static state_type const max_state = last_state + 1;
//
// Where first_state should be equal to BaseClass::max_state.
// These should represent the minimum and (one past) the maximum
// values of mRunState.
//
// virtual void initialize_impl(void)
//
// Initializes the derived class.
//
// virtual void multiplex_impl(void);
//
// This method should handle mRunState in a switch.
// For example:
//
// switch(mRunState)
// {
// case foo:
// handle_foo();
// break;
// case wait_state:
// if (still_waiting())
// {
// idle();
// break;
// }
// set_state(working);
// /*fall-through*/
// case working:
// do_work();
// if (failure())
// abort();
// break;
// case etc:
// etc();
// finish();
// break;
// }
//
// virtual void abort_impl(void);
//
// A call to this method should bring the object to a state
// where finish_impl() can be called.
//
// virtual void finish_impl(void);
//
// Should cleanup whatever init_impl() did, or any of the
// states of the object where multiplex_impl() calls finish().
// Call kill() from here to make that the default behavior
// (state machine is deleted unless the callback calls run()).
//
// virtual char const* state_str_impl(state_type run_state);
//
// Should return a stringified value of run_state.
//
class AIStateMachine {
//! The type of mState
enum base_state_type {
bs_initialize,
bs_run,
bs_abort,
bs_finish,
bs_callback,
bs_killed
};
//! The type of mActive
enum active_type {
as_idle, // State machine is on neither list.
as_queued, // State machine is on continued_statemachines list.
as_active // State machine is on active_statemachines list.
};
//! Type of continued_statemachines.
typedef std::vector<AIStateMachine*> continued_statemachines_type;
//! Type of sContinuedStateMachinesAndMainloopEnabled.
struct csme_type
{
continued_statemachines_type continued_statemachines;
bool mainloop_enabled;
};
public:
typedef U32 state_type; //!< The type of mRunState
//! Integral value equal to the state with the lowest value.
static state_type const min_state = bs_initialize;
//! Integral value one more than the state with the highest value.
static state_type const max_state = bs_killed + 1;
private:
base_state_type mState; //!< State of the base class.
bool mIdle; //!< True if this state machine is not running.
bool mAborted; //!< True after calling abort() and before calling run().
active_type mActive; //!< Whether statemachine is idle, queued to be added to the active list, or already on the active list.
S64 mSleep; //!< Non-zero while the state machine is sleeping.
LLMutex mIdleActive; //!< Used for atomic operations on the pair mIdle / mActive.
#ifdef SHOW_ASSERT
AIThreadID mContThread; //!< Thread that last called locked_cont().
bool mCalledThreadUnsafeIdle; //!< Set to true when idle() is called.
#endif
// Callback facilities.
// From within an other state machine:
AIStateMachine* mParent; //!< The parent object that started this state machine, or NULL if there isn't any.
state_type mNewParentState; //!< The state at which the parent should continue upon a successful finish.
bool mAbortParent; //!< If true, abort parent on abort(). Otherwise continue as normal.
bool mOnAbortSignalParent; //!< If true and mAbortParent is false, change state of parent even on abort.
// From outside a state machine:
struct callback_type {
typedef boost::signals2::signal<void (bool)> signal_type;
callback_type(signal_type::slot_type const& slot) { connection = signal.connect(slot); }
~callback_type() { connection.disconnect(); }
void callback(bool success) const { signal(success); }
private:
boost::signals2::connection connection;
signal_type signal;
};
callback_type* mCallback; //!< Pointer to signal/connection, or NULL when not connected.
static U64 sMaxCount; //!< Number of cpu clocks below which we start a new state machine within the same frame.
static AIThreadSafeDC<csme_type> sContinuedStateMachinesAndMainloopEnabled; //!< Read/write locked variable pair.
protected:
LLMutex mSetStateLock; //!< For critical areas in set_state() and locked_cont().
//! State of the derived class. Only valid if mState == bs_run. Call set_state to change.
volatile state_type mRunState;
public:
//! Create a non-running state machine.
AIStateMachine(void) : mState(bs_initialize), mIdle(true), mAborted(true), mActive(as_idle), mSleep(0), mParent(NULL), mCallback(NULL)
#ifdef SHOW_ASSERT
, mContThread(AIThreadID::none), mCalledThreadUnsafeIdle(false)
#endif
{ }
protected:
//! The user should call 'kill()', not delete a AIStateMachine (derived) directly.
virtual ~AIStateMachine() { llassert((mState == bs_killed && mActive == as_idle) || mState == bs_initialize); }
public:
//! Halt the state machine until cont() is called (not thread-safe).
void idle(void);
//! Halt the state machine until cont() is called, provided it is still in 'cur_run_state'.
void idle(state_type current_run_state);
//! Temporarily halt the state machine.
void yield_frame(unsigned int frames) { mSleep = -(S64)frames; }
//! Temporarily halt the state machine.
void yield_ms(unsigned int ms) { mSleep = get_clock_count() + calc_clock_frequency() * ms / 1000; }
//! Continue running after calling idle.
void cont(void)
{
mSetStateLock.lock();
// Ignore calls to cont() if the statemachine isn't idle. See comments in set_state().
// Calling cont() twice or after calling set_state(), without first calling idle(), is an error.
if (mState != bs_run || !mIdle) { llassert(mState != bs_run || !mContThread.equals_current_thread()); mSetStateLock.unlock(); return; }
locked_cont();
}
private:
void locked_cont(void);
public:
//---------------------------------------
// Changing the state.
//! Change state to <code>bs_run</code>. May only be called after creation or after returning from finish().
// If <code>parent</code> is non-NULL, change the parent state machine's state to <code>new_parent_state</code>
// upon finish, or in the case of an abort and when <code>abort_parent</code> is true, call parent->abort() instead.
void run(AIStateMachine* parent, state_type new_parent_state, bool abort_parent = true, bool on_abort_signal_parent = true);
//! Change state to 'bs_run'. May only be called after creation or after returning from finish().
// Does not cause a callback.
void run(void) { run(NULL, 0, false); }
//! The same as above, but pass the result of a boost::bind with _1.
//
// Here _1, if present, will be replaced with a bool indicating success.
//
// For example:
//
// <code>
// struct Foo { void callback(AIStateMachineDerived* ptr, bool success); };
// ...
// AIStateMachineDerived* magic = new AIStateMachineDerived; // Deleted by callback
// // Call foo_ptr->callback(magic, _1) on finish.
// state_machine->run(boost::bind(&Foo::callback, foo_ptr, magic, _1));
// </code>
//
// or
//
// <code>
// struct Foo { void callback(bool success, AIStateMachineDerived const& magic); };
// ...
// AIStateMachineDerived magic;
// // Call foo_ptr->callback(_1, magic) on finish.
// magic.run(boost::bind(&Foo::callback, foo_ptr, _1, magic));
// </code>
//
// or
//
// <code>
// static void callback(void* userdata);
// ...
// AIStateMachineDerived magic;
// // Call callback(userdata) on finish.
// magic.run(boost::bind(&callback, userdata));
// </code>
void run(callback_type::signal_type::slot_type const& slot);
//! Change state to 'bs_abort'. May only be called while in the bs_run state.
void abort(void);
//! Change state to 'bs_finish'. May only be called while in the bs_run state.
void finish(void);
//! Refine state while in the bs_run state. May only be called while in the bs_run state.
void set_state(state_type run_state);
//! Change state to 'bs_killed'. May only be called while in the bs_finish state.
void kill(void);
//---------------------------------------
// Other.
//! Called whenever the StateMachineMaxTime setting is changed.
static void setMaxCount(F32 StateMachineMaxTime);
//---------------------------------------
// Accessors.
//! Return true if state machine was aborted (can be used in finish_impl).
bool aborted(void) const { return mAborted; }
//! Return true if the derived class is running (also when we are idle).
bool running(void) const { return mState == bs_run; }
//! Return true if it's safe to call abort.
bool abortable(void) const { return mState == bs_run || mState == bs_initialize; }
//! Return true if the derived class is running but idle.
bool waiting(void) const { return mState == bs_run && mIdle; }
// Use some safebool idiom (http://www.artima.com/cppsource/safebool.html) rather than operator bool.
typedef volatile state_type AIStateMachine::* const bool_type;
//! Return true if state machine successfully finished.
operator bool_type() const { return ((mState == bs_initialize || mState == bs_callback) && !mAborted) ? &AIStateMachine::mRunState : 0; }
//! Return a stringified state, for debugging purposes.
char const* state_str(state_type state);
private:
static void add_continued_statemachines(AIReadAccess<csme_type>& csme_r);
static void dowork(void);
void multiplex(U64 current_time);
public:
//! Call this once per frame to give the statemachines CPU cycles.
static void mainloop(void)
{
{
AIReadAccess<csme_type> csme_r(sContinuedStateMachinesAndMainloopEnabled, true);
if (!csme_r->mainloop_enabled)
return;
if (!csme_r->continued_statemachines.empty())
add_continued_statemachines(csme_r);
}
dowork();
}
//! Abort all running state machines and then run mainloop until all state machines are idle (called when application is exiting).
static void flush(void);
protected:
//---------------------------------------
// Derived class implementations.
// Handle initializing the object.
virtual void initialize_impl(void) = 0;
// Handle mRunState.
virtual void multiplex_impl(void) = 0;
// Handle aborting from current bs_run state.
virtual void abort_impl(void) = 0;
// Handle cleaning up from initialization (or post abort) state.
virtual void finish_impl(void) = 0;
// Implemenation of state_str for run states.
virtual char const* state_str_impl(state_type run_state) const = 0;
};
// This case be used in state_str_impl.
#define AI_CASE_RETURN(x) do { case x: return #x; } while(0)
#endif

View File

@@ -1,96 +0,0 @@
/**
* @file aitimer.cpp
* @brief Implementation of AITimer
*
* Copyright (c) 2012, Aleric Inglewood.
*
* 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, see <http://www.gnu.org/licenses/>.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution.
*
* CHANGELOG
* and additional copyright holders.
*
* 07/02/2012
* Initial version, written by Aleric Inglewood @ SL
*/
#include "linden_common.h"
#include "aitimer.h"
enum timer_state_type {
AITimer_start = AIStateMachine::max_state,
AITimer_expired
};
char const* AITimer::state_str_impl(state_type run_state) const
{
switch(run_state)
{
AI_CASE_RETURN(AITimer_start);
AI_CASE_RETURN(AITimer_expired);
}
return "UNKNOWN STATE";
}
void AITimer::initialize_impl(void)
{
llassert(!mFrameTimer.isRunning());
set_state(AITimer_start);
}
void AITimer::expired(void)
{
set_state(AITimer_expired);
}
void AITimer::multiplex_impl(void)
{
switch (mRunState)
{
case AITimer_start:
{
mFrameTimer.create(mInterval, boost::bind(&AITimer::expired, this));
idle();
break;
}
case AITimer_expired:
{
finish();
break;
}
}
}
void AITimer::abort_impl(void)
{
mFrameTimer.cancel();
}
void AITimer::finish_impl(void)
{
// Kill object by default.
// This can be overridden by calling run() from the callback function.
kill();
}
void AIPersistentTimer::finish_impl(void)
{
// Don't kill object by default.
if (aborted())
kill();
// Callback function should always call kill() or run().
}

View File

@@ -1,117 +0,0 @@
/**
* @file aitimer.h
* @brief Generate a timer event
*
* Copyright (c) 2012, Aleric Inglewood.
*
* 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, see <http://www.gnu.org/licenses/>.
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution.
*
* CHANGELOG
* and additional copyright holders.
*
* 07/02/2012
* Initial version, written by Aleric Inglewood @ SL
*/
#ifndef AITIMER_H
#define AITIMER_H
#include "aistatemachine.h"
#include "aiframetimer.h"
// A timer state machine.
//
// Before calling run(), call setInterval() to pass needed parameters.
//
// When the state machine finishes it calls the callback, use parameter _1,
// (success) to check whether or not the statemachine actually timed out or
// was cancelled. The boolean is true when it expired and false if the
// state machine was aborted.
//
// Objects of this type can be reused multiple times, see
// also the documentation of AIStateMachine.
//
// Typical usage:
//
// AITimer* timer = new AITimer;
//
// timer->setInterval(5.5); // 5.5 seconds time out interval.
// timer->run(...); // Start timer and pass callback; see AIStateMachine.
//
// The default behavior is to call the callback and then delete the AITimer object.
// One can call run() again from the callback function to get a repeating expiration.
// You can call run(...) with parameters too, but using run() without parameters will
// just reuse the old ones (call the same callback).
//
class AITimer : public AIStateMachine {
private:
AIFrameTimer mFrameTimer; //!< The actual timer that this object wraps.
F64 mInterval; //!< Input variable: interval after which the event will be generated, in seconds.
public:
AITimer(void) : mInterval(0) { DoutEntering(dc::statemachine, "AITimer(void) [" << (void*)this << "]"); }
/**
* @brief Set the interval after which the timer should expire.
*
* @param interval Amount of time in seconds before the timer will expire.
*
* Call abort() at any time to stop the timer (and delete the AITimer object).
*/
void setInterval(F64 interval) { mInterval = interval; }
/**
* @brief Get the expiration interval.
*
* @returns expiration interval in seconds.
*/
F64 getInterval(void) const { return mInterval; }
protected:
// Call finish() (or abort()), not delete.
/*virtual*/ ~AITimer() { DoutEntering(dc::statemachine, "~AITimer() [" << (void*)this << "]"); mFrameTimer.cancel(); }
// Handle initializing the object.
/*virtual*/ void initialize_impl(void);
// Handle mRunState.
/*virtual*/ void multiplex_impl(void);
// Handle aborting from current bs_run state.
/*virtual*/ void abort_impl(void);
// Handle cleaning up from initialization (or post abort) state.
/*virtual*/ void finish_impl(void);
// Implemenation of state_str for run states.
/*virtual*/ char const* state_str_impl(state_type run_state) const;
private:
// This is the callback for mFrameTimer.
void expired(void);
};
// Same as above but does not delete itself automatically by default after use.
// Call kill() on it yourself (from the callback function) when you're done with it!
class AIPersistentTimer : public AITimer {
protected:
// Handle cleaning up from initialization (or post abort) state.
/*virtual*/ void finish_impl(void);
};
#endif

View File

@@ -12,42 +12,48 @@ set(CMAKE_CXX_FLAGS_RELEASE
"-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=1 -DNDEBUG") "-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=1 -DNDEBUG")
set(CMAKE_C_FLAGS_RELEASE set(CMAKE_C_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE}") "${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELEASESSE2
"-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=1 -DNDEBUG")
#llimage now requires this (?)
set(CMAKE_C_FLAGS_RELEASESSE2
"${CMAKE_CXX_FLAGS_RELEASESSE2}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"-DLL_RELEASE=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1") "-DLL_RELEASE=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=0 -DNDEBUG -DLL_RELEASE_WITH_DEBUG_INFO=1")
# Don't bother with a MinSizeRel build. # Don't bother with a MinSizeRel build.
set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;ReleaseSSE2;Debug" CACHE STRING
"Supported build types." FORCE) "Supported build types." FORCE)
# Platform-specific compilation flags. # Platform-specific compilation flags.
if (WINDOWS) if (WINDOWS)
# Remove default /Zm1000 flag that cmake inserts
string (REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
# Don't build DLLs. # Don't build DLLs.
set(BUILD_SHARED_LIBS OFF) set(BUILD_SHARED_LIBS OFF)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /MP /arch:SSE2" set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /arch:SSE2"
CACHE STRING "C++ compiler debug options" FORCE) CACHE STRING "C++ compiler debug options" FORCE)
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO set(CMAKE_CXX_FLAGS_RELWITHDEBINFO
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /arch:SSE2" "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /arch:SSE2"
CACHE STRING "C++ compiler release-with-debug options" FORCE) CACHE STRING "C++ compiler release-with-debug options" FORCE)
set(CMAKE_CXX_FLAGS_RELEASE set(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /arch:SSE2 /fp:fast" "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /arch:SSE /fp:fast"
CACHE STRING "C++ compiler release options" FORCE) CACHE STRING "C++ compiler release options" FORCE)
set(CMAKE_C_FLAGS_RELEASE set(CMAKE_C_FLAGS_RELEASE
"${CMAKE_C_FLAGS_RELEASE} ${LL_C_FLAGS} /O2 /Zi /MD /MP /arch:SSE2 /fp:fast" "${CMAKE_C_FLAGS_RELEASE} ${LL_C_FLAGS} /O2 /Zi /MD /MP /arch:SSE /fp:fast"
CACHE STRING "C compiler release options" FORCE) CACHE STRING "C compiler release options" FORCE)
set(CMAKE_CXX_FLAGS_RELEASESSE2
"${CMAKE_CXX_FLAGS_RELEASESSE2} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /arch:SSE2 /fp:fast"
CACHE STRING "C++ compiler release-SSE2 options" FORCE)
set(CMAKE_C_FLAGS_RELEASESSE2
"${CMAKE_C_FLAGS_RELEASESSE2} ${LL_C_FLAGS} /O2 /Zi /MD /MP /arch:SSE2 /fp:fast"
CACHE STRING "C compiler release-SSE2 options" FORCE)
if(NOT CMAKE_EXE_LINKER_FLAGS_RELEASE MATCHES LARGEADDRESSAWARE) set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LARGEADDRESSAWARE")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LARGEADDRESSAWARE")
endif()
set(CMAKE_CXX_STANDARD_LIBRARIES "") set(CMAKE_CXX_STANDARD_LIBRARIES "")
set(CMAKE_C_STANDARD_LIBRARIES "") set(CMAKE_C_STANDARD_LIBRARIES "")
add_definitions( add_definitions(
/DLL_WINDOWS=1 /DLL_WINDOWS=1
/DUNICODE /DUNICODE
@@ -61,42 +67,42 @@ if (WINDOWS)
/Oy- /Oy-
) )
# configure win32 API for windows XP+ compatibility
set(WINVER "0x0501" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}")
if(MSVC80 OR MSVC90 OR MSVC10) if(MSVC80 OR MSVC90 OR MSVC10)
set(CMAKE_CXX_FLAGS_RELEASE set(CMAKE_CXX_FLAGS_RELEASE
"${CMAKE_CXX_FLAGS_RELEASE} -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0" "${CMAKE_CXX_FLAGS_RELEASE} -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
CACHE STRING "C++ compiler release options" FORCE) CACHE STRING "C++ compiler release options" FORCE)
set(CMAKE_C_FLAGS_RELEASE set(CMAKE_CXX_FLAGS_RELEASESSE2
"${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "C compiler release options" FORCE) "${CMAKE_CXX_FLAGS_RELEASESSE2} -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
CACHE STRING "C++ compiler release-SSE2 options" FORCE)
set(CMAKE_C_FLAGS_RELEASESSE2
"${CMAKE_CXX_FLAGS_RELEASESSE2} -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
CACHE STRING "C compiler release-SSE2 options" FORCE)
add_definitions( add_definitions(
/Zc:wchar_t- /Zc:wchar_t-
) )
endif (MSVC80 OR MSVC90 OR MSVC10) endif (MSVC80 OR MSVC90 OR MSVC10)
# Are we using the crummy Visual Studio KDU build workaround? # Are we using the crummy Visual Studio KDU build workaround?
if (NOT DISABLE_FATAL_WARNINGS) if (NOT VS_DISABLE_FATAL_WARNINGS)
add_definitions(/WX) add_definitions(/WX)
endif (NOT DISABLE_FATAL_WARNINGS) endif (NOT VS_DISABLE_FATAL_WARNINGS)
# Various libs are compiler specific, generate some variables here we can just use # Various libs are compiler specific, generate some variables here we can just use
# when we require them instead of reimplementing the test each time. # when we require them instead of reimplementing the test each time.
if (MSVC71) if (MSVC71)
set(MSVC_DIR 7.1) set(MSVC_DIR 7.1)
set(MSVC_SUFFIX 71) set(MSVC_SUFFIX 71)
elseif (MSVC80) elseif (MSVC80)
set(MSVC_DIR 8.0) set(MSVC_DIR 8.0)
set(MSVC_SUFFIX 80) set(MSVC_SUFFIX 80)
elseif (MSVC90) elseif (MSVC90)
set(MSVC_DIR 9.0) set(MSVC_DIR 9.0)
set(MSVC_SUFFIX 90) set(MSVC_SUFFIX 90)
elseif (MSVC10) elseif (MSVC10)
set(MSVC_DIR 10.0) set(MSVC_DIR 10.0)
set(MSVC_SUFFIX 100) set(MSVC_SUFFIX 100)
endif (MSVC71) endif (MSVC71)
if (MSVC10) if (MSVC10)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
@@ -107,208 +113,138 @@ if (WINDOWS)
endif (WINDOWS) endif (WINDOWS)
set (GCC_EXTRA_OPTIMIZATIONS "-ffast-math") set (GCC_EXTRA_OPTIMIZATIONS "-ffast-math -frounding-math")
if (LINUX) if (LINUX)
set(CMAKE_SKIP_RPATH TRUE) set(CMAKE_SKIP_RPATH TRUE)
# Here's a giant hack for Fedora 8, where we can't use
# _FORTIFY_SOURCE if we're using a compiler older than gcc 4.1.
find_program(GXX g++)
mark_as_advanced(GXX)
if (GXX)
execute_process(
COMMAND ${GXX} --version
COMMAND sed "s/^[gc+ ]*//"
COMMAND head -1
OUTPUT_VARIABLE GXX_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else (GXX)
set(GXX_VERSION x)
endif (GXX)
# The quoting hack here is necessary in case we're using distcc or
# ccache as our compiler. CMake doesn't pass the command line
# through the shell by default, so we end up trying to run "distcc"
# " g++" - notice the leading space. Ugh.
execute_process(
COMMAND sh -c "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version"
COMMAND sed "s/^[gc+ ]*//"
COMMAND head -1
OUTPUT_VARIABLE CXX_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
if (${GXX_VERSION} STREQUAL ${CXX_VERSION})
add_definitions(-D_FORTIFY_SOURCE=2)
else (${GXX_VERSION} STREQUAL ${CXX_VERSION})
if (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat")
add_definitions(-D_FORTIFY_SOURCE=2)
endif (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat")
endif (${GXX_VERSION} STREQUAL ${CXX_VERSION})
#Lets actualy get a numerical version of gxx's version
STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1\\2\\3" CXX_VERSION ${CXX_VERSION})
#gcc 4.3 and above don't like the LL boost
if(${CXX_VERSION} GREATER 429)
add_definitions(-Wno-parentheses)
endif (${CXX_VERSION} GREATER 429)
#gcc 4.6 has a new spammy warning
if(NOT ${CXX_VERSION} LESS 460)
add_definitions(-Wno-unused-but-set-variable)
endif (NOT ${CXX_VERSION} LESS 460)
# End of hacks.
add_definitions( add_definitions(
-DLL_LINUX=1 -DLL_LINUX=1
-DAPPID=secondlife
-D_REENTRANT -D_REENTRANT
-fexceptions -fexceptions
-fno-math-errno -fno-math-errno
-fno-strict-aliasing -fno-strict-aliasing
-fsigned-char -fsigned-char
-fvisibility=hidden
-g -g
-pthread -pthread
) )
# Don't catch SIGCHLD in our base application class for the viewer add_definitions(-DAPPID=secondlife)
# some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! add_definitions(-fvisibility=hidden)
# The viewer doesn't need to catch SIGCHLD anyway. # don't catch SIGCHLD in our base application class for the viewer - some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The viewer doesn't need to catch SIGCHLD anyway.
add_definitions(-DLL_IGNORE_SIGCHLD) add_definitions(-DLL_IGNORE_SIGCHLD)
if (NOT STANDALONE)
if(${CMAKE_C_COMPILER} MATCHES "gcc*") # this stops us requiring a really recent glibc at runtime
find_program(GXX g++) add_definitions(-fno-stack-protector)
mark_as_advanced(GXX) endif (NOT STANDALONE)
if (${ARCH} STREQUAL "x86_64")
if (GXX) add_definitions(-DLINUX64=1 -pipe)
execute_process( set(CMAKE_CXX_FLAGS_RELEASESSE2 "${CMAKE_CXX_FLAGS_RELEASESSE2} -fomit-frame-pointer -mmmx -msse -mfpmath=sse -msse2 -ffast-math -ftree-vectorize -fweb -fexpensive-optimizations -frename-registers")
COMMAND ${GXX} --version set(CMAKE_C_FLAGS_RELEASESSE2 "${CMAKE_C_FLAGS_RELEASESSE2} -fomit-frame-pointer -mmmx -msse -mfpmath=sse -msse2 -ffast-math -ftree-vectorize -fweb -fexpensive-optimizations -frename-registers")
COMMAND sed "s/^[gc+ ]*//" set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fomit-frame-pointer -mmmx -msse -mfpmath=sse -msse2 -ffast-math -ftree-vectorize -fweb -fexpensive-optimizations -frename-registers")
COMMAND head -1 set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -fomit-frame-pointer -mmmx -msse -mfpmath=sse -msse2 -ffast-math -ftree-vectorize -fweb -fexpensive-optimizations -frename-registers")
OUTPUT_VARIABLE GXX_VERSION else (${ARCH} STREQUAL "x86_64")
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else (GXX)
set(GXX_VERSION x)
endif (GXX)
# The quoting hack here is necessary in case we're using distcc or
# ccache as our compiler. CMake doesn't pass the command line
# through the shell by default, so we end up trying to run "distcc"
# " g++" - notice the leading space. Ugh.
execute_process(
COMMAND sh -c "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} --version"
COMMAND sed "s/^[gc+ ]*//"
COMMAND head -1
OUTPUT_VARIABLE CXX_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Here's a giant hack for Fedora 8, where we can't use
# _FORTIFY_SOURCE if we're using a compiler older than gcc 4.1.
if (${GXX_VERSION} STREQUAL ${CXX_VERSION})
add_definitions(-D_FORTIFY_SOURCE=2)
else (${GXX_VERSION} STREQUAL ${CXX_VERSION})
if (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat")
add_definitions(-D_FORTIFY_SOURCE=2)
endif (NOT ${GXX_VERSION} MATCHES " 4.1.*Red Hat")
endif (${GXX_VERSION} STREQUAL ${CXX_VERSION})
#Lets actually get a numerical version of gxx's version
STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.([0-9]).*" "\\1\\2\\3" CXX_VERSION ${CXX_VERSION})
#gcc 4.3 and above doesn't like the LL boost
if(${CXX_VERSION} GREATER 429)
add_definitions(-Wno-parentheses)
endif (${CXX_VERSION} GREATER 429)
#gcc 4.6 has a new spammy warning
if(NOT ${CXX_VERSION} LESS 460)
add_definitions(-Wno-unused-but-set-variable)
endif (NOT ${CXX_VERSION} LESS 460)
# End of hacks.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
if (NOT STANDALONE) if (NOT STANDALONE)
# this stops us requiring a really recent glibc at runtime set(MARCH_FLAG " -march=pentium4")
add_definitions(-fno-stack-protector)
endif (NOT STANDALONE) endif (NOT STANDALONE)
if (${ARCH} STREQUAL "x86_64") set(CMAKE_CXX_FLAGS_RELEASESSE2 "${CMAKE_CXX_FLAGS_RELEASESSE2}${MARCH_FLAG} -mfpmath=sse -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
add_definitions(-DLINUX64=1 -pipe) set(CMAKE_C_FLAGS_RELEASESSE2 "${CMAKE_C_FLAGS_RELEASESSE2}${MARCH_FLAG} -mfpmath=sse -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer -ffast-math -funroll-loops") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fomit-frame-pointer -ffast-math -funroll-loops") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -ffast-math") endif (${ARCH} STREQUAL "x86_64")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ffast-math")
else (${ARCH} STREQUAL "x86_64")
if (NOT STANDALONE)
set(MARCH_FLAG " -march=pentium4")
endif (NOT STANDALONE)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse,387 -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
endif (${ARCH} STREQUAL "x86_64")
elseif(${CMAKE_C_COMPILER} MATCHES "clang*")
find_program(CLANG clang)
mark_as_advanced(CLANG)
find_program(CLANGXX clang++)
mark_as_advanced(CLANGXX)
add_definitions( set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG} -msse2")
-D_FORTIFY_SOURCE=2
)
if (NOT STANDALONE)
# this stops us requiring a really recent glibc at runtime
add_definitions(-fno-stack-protector)
endif (NOT STANDALONE)
if (NOT STANDALONE)
set(MARCH_FLAG " -march=pentium4")
endif (NOT STANDALONE)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline -msse2")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -msse2")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -msse2")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse2")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -msse2")
elseif(${CMAKE_C_COMPILER} MATCHES "icc*" AND ${CMAKE_CXX_COMPILER} MATCHES "icpc*")
find_program(ICC icc)
mark_as_advanced(ICC)
add_definitions(
-D_FORTIFY_SOURCE=2
)
if (NOT STANDALONE)
# this stops us requiring a really recent glibc at runtime
add_definitions(-fno-stack-protector)
endif (NOT STANDALONE)
if (NOT STANDALONE)
set(MARCH_FLAG " -axsse4.1 -msse2")
endif (NOT STANDALONE)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline-functions")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}${MARCH_FLAG} -fno-inline-functions")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}${MARCH_FLAG} -parallel -fp-model fast=1")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}${MARCH_FLAG} -parallel -fp-model fast=1")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -parallel -fp-model fast=1")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -parallel -fp-model fast=1")
endif()
set(CMAKE_CXX_FLAGS_DEBUG "-O0 ${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_C_FLAGS_DEBUG "-O0 ${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE}") set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_C_FLAGS_RELEASE "-O3 ${CMAKE_C_FLAGS_RELEASE}") set(CMAKE_C_FLAGS_RELEASE "-O3 ${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_RELEASESSE2 "-O3 ${CMAKE_CXX_FLAGS_RELEASESSE2}")
set(CMAKE_C_FLAGS_RELEASESSE2 "-O3 ${CMAKE_C_FLAGS_RELEASESSE2}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_C_FLAGS_RELWITHDEBINFO}") set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
endif (LINUX) endif (LINUX)
if (DARWIN) if (DARWIN)
add_definitions(-DLL_DARWIN=1 -D_XOPEN_SOURCE) add_definitions(-DLL_DARWIN=1)
set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first") set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
if(${CMAKE_C_COMPILER} MATCHES "gcc*") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-branch")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mlong-branch") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-branch")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mlong-branch") # NOTE: it's critical that the optimization flag is put in front.
# NOTE: it's critical that the optimization flag is put in front. # NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered. set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -03 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -03 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O3 -msse3 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}") set(CMAKE_CXX_FLAGS_RELEASESSE2 "${CMAKE_CXX_FLAGS_RELEASESSE2} -O3 -msse2 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
elseif(${CMAKE_C_COMPILER} MATCHES "clang*") set(CMAKE_C_FLAGS_RELEASESSE2 "${CMAKE_C_FLAGS_RELEASESSE2} -03 -msse2 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
# NOTE: it's critical that the optimization flag is put in front.
# NOTE: it's critical to have both CXX_FLAGS and C_FLAGS covered.
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -msse3")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -msse3")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -msse3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -O3 -msse3")
endif()
endif (DARWIN) endif (DARWIN)
if (LINUX OR DARWIN) if (LINUX OR DARWIN)
if(${CMAKE_C_COMPILER} MATCHES "gcc*") set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
set(UNIX_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Woverloaded-virtual") if (NOT GCC_DISABLE_FATAL_WARNINGS)
elseif(${CMAKE_C_COMPILER} MATCHES "clang*") set(GCC_WARNINGS "${GCC_WARNINGS} -Werror")
set(UNIX_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs -Wno-tautological-compare -Wno-char-subscripts -Wno-gnu -Wno-logical-op-parentheses -Wno-non-virtual-dtor ") endif (NOT GCC_DISABLE_FATAL_WARNINGS)
set(UNIX_WARNINGS "${UNIX_WARNINGS} -Woverloaded-virtual -Wno-parentheses-equality -Wno-reorder -Wno-unused-function -Wno-unused-value -Wno-unused-variable")
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS}") set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Woverloaded-virtual")
elseif(${CMAKE_C_COMPILER} MATCHES "icc")
set(UNIX_WARNINGS "-wd327 -wd597 -wd858") set(CMAKE_C_FLAGS "${GCC_WARNINGS} ${CMAKE_C_FLAGS}")
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS}") set(CMAKE_CXX_FLAGS "${GCC_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")
endif()
if (NOT DISABLE_FATAL_WARNINGS)
set(UNIX_WARNINGS "${UNIX_WARNINGS} -Werror")
endif (NOT DISABLE_FATAL_WARNINGS)
set(CMAKE_C_FLAGS "${UNIX_WARNINGS} ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${UNIX_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")
if (WORD_SIZE EQUAL 32) if (WORD_SIZE EQUAL 32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
@@ -328,31 +264,26 @@ else (STANDALONE)
glib-2.0 glib-2.0
gstreamer-0.10 gstreamer-0.10
gtk-2.0 gtk-2.0
freetype2 llfreetype2
pango-1.0 pango-1.0
) )
endif (STANDALONE) endif (STANDALONE)
if(1 EQUAL 1) if(1 EQUAL 1)
add_definitions(-DOPENSIM_RULES=1) add_definitions(-DOPENSIM_RULES=1)
add_definitions(-DMESH_ENABLED=1) add_definitions(-DMESH_ENABLED=1)
add_definitions(-DENABLE_CLASSIC_CLOUDS=1)
if (NOT "$ENV{SHY_MOD}" STREQUAL "")
add_definitions(-DSHY_MOD=1)
endif (NOT "$ENV{SHY_MOD}" STREQUAL "")
endif(1 EQUAL 1) endif(1 EQUAL 1)
SET( CMAKE_EXE_LINKER_FLAGS_RELEASE SET( CMAKE_EXE_LINKER_FLAGS_RELEASESSE2
"${CMAKE_EXE_LINKER_FLAGS_RELEASE}" CACHE STRING "${CMAKE_EXE_LINKER_FLAGS_RELEASE}" CACHE STRING
"Flags used for linking binaries under build." "Flags used for linking binaries under SSE2 build."
FORCE ) FORCE )
SET( CMAKE_SHARED_LINKER_FLAGS_RELEASE SET( CMAKE_SHARED_LINKER_FLAGS_RELEASESSE2
"${CMAKE_SHARED_LINKER_FLAGS_RELEASE}" CACHE STRING "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}" CACHE STRING
"Flags used by the shared libraries linker under build." "Flags used by the shared libraries linker under SSE2 build."
FORCE ) FORCE )
MARK_AS_ADVANCED( MARK_AS_ADVANCED(
CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASESSE2
CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELEASESSE2
CMAKE_EXE_LINKER_FLAGS_RELEASE CMAKE_EXE_LINKER_FLAGS_RELEASESSE2
CMAKE_SHARED_LINKER_FLAGS_RELEASE CMAKE_SHARED_LINKER_FLAGS_RELEASESSE2 )
)

View File

@@ -1,4 +1,4 @@
# -*- cmake -*- # -*- cmake -*-
set(AISTATEMACHINE_INCLUDE_DIRS ${LIBS_OPEN_DIR}/aistatemachine) set(AISTATEMACHINE_INCLUDE_DIRS statemachine)
set(AISTATEMACHINE_LIBRARIES aistatemachine) set(AISTATEMACHINE_LIBRARIES statemachine)

View File

@@ -29,12 +29,12 @@ else (STANDALONE)
) )
elseif (DARWIN) elseif (DARWIN)
set(APR_LIBRARIES set(APR_LIBRARIES
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.0.dylib debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.0.3.7.dylib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.0.dylib optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.0.3.7.dylib
) )
set(APRUTIL_LIBRARIES set(APRUTIL_LIBRARIES
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.dylib debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.0.3.8.dylib
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.dylib optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.0.3.8.dylib
) )
set(APRICONV_LIBRARIES iconv) set(APRICONV_LIBRARIES iconv)
else (WINDOWS) else (WINDOWS)

View File

@@ -9,7 +9,7 @@ if (STANDALONE)
pkg_check_modules(VORBISFILE REQUIRED vorbisfile) pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(ogg-vorbis) use_prebuilt_binary(ogg-vorbis)
set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS}) set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS}) set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
@@ -40,11 +40,3 @@ link_directories(
${VORBISFILE_LIBRARY_DIRS} ${VORBISFILE_LIBRARY_DIRS}
${OGG_LIBRARY_DIRS} ${OGG_LIBRARY_DIRS}
) )
set(LLAUDIO_VORBIS_LIBRARIES
${VORBISENC_LIBRARIES}
${VORBISFILE_LIBRARIES}
${VORBIS_LIBRARIES}
${OGG_LIBRARIES}
)

View File

@@ -1,4 +1,4 @@
include(Prebuilt) # -*- cmake -*-
set(DB_FIND_QUIETLY ON) set(DB_FIND_QUIETLY ON)
set(DB_FIND_REQUIRED ON) set(DB_FIND_REQUIRED ON)
@@ -8,10 +8,9 @@ if (STANDALONE)
else (STANDALONE) else (STANDALONE)
if (LINUX) if (LINUX)
# Need to add dependency pthread explicitely to support ld.gold. # Need to add dependency pthread explicitely to support ld.gold.
use_prebuilt_binary(db) set(DB_LIBRARIES db-4.2 pthread)
set(DB_LIBRARIES db-5.1 pthread)
else (LINUX) else (LINUX)
set(DB_LIBRARIES db-4.2) set(DB_LIBRARIES db-4.2)
endif (LINUX) endif (LINUX)
set(DB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) set(DB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -7,45 +7,47 @@ set(Boost_FIND_REQUIRED ON)
if (STANDALONE) if (STANDALONE)
include(FindBoost) include(FindBoost)
set(Boost_USE_MULTITHREADED ON) set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
find_package(Boost 1.40.0 COMPONENTS date_time filesystem program_options regex system thread wave) set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
set(BOOST_REGEX_LIBRARY boost_regex-mt)
set(BOOST_SYSTEM_LIBRARY boost_system-mt)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(boost) use_prebuilt_binary(boost)
set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
if (WINDOWS) if (WINDOWS)
set(BOOST_VERSION 1_45) set(BOOST_VERSION 1_45)
# SNOW-788 # SNOW-788
# 00-Common.cmake alreay sets MSVC_SUFFIX to be correct for the VS we are using eg VC71, VC80, VC90 etc # 00-Common.cmake alreay sets MSVC_SUFFIX to be correct for the VS we are using eg VC71, VC80, VC90 etc
# The precompiled boost libs for VC71 use a different suffix to VS80 and VS90 # The precompiled boost libs for VC71 use a different suffix to VS80 and VS90
# This code should ensure the cmake rules are valid for any VS being used in future as long as the approprate # This code should ensure the cmake rules are valid for any VS being used in future as long as the approprate
# boost libs are avaiable - RC. # boost libs are avaiable - RC.
if (MSVC71) if (MSVC71)
set(BOOST_OPTIM_SUFFIX mt-s) set(BOOST_OPTIM_SUFFIX mt-s)
set(BOOST_DEBUG_SUFFIX mt-sgd) set(BOOST_DEBUG_SUFFIX mt-sgd)
else (MSVC71) else (MSVC71)
set(BOOST_OPTIM_SUFFIX mt) set(BOOST_OPTIM_SUFFIX mt)
set(BOOST_DEBUG_SUFFIX mt-gd) set(BOOST_DEBUG_SUFFIX mt-gd)
endif (MSVC71) endif (MSVC71)
set(Boost_PROGRAM_OPTIONS_LIBRARY set(BOOST_PROGRAM_OPTIONS_LIBRARY
optimized libboost_program_options-vc${MSVC_SUFFIX}-${BOOST_OPTIM_SUFFIX}-${BOOST_VERSION} optimized libboost_program_options-vc${MSVC_SUFFIX}-${BOOST_OPTIM_SUFFIX}-${BOOST_VERSION}
debug libboost_program_options-vc${MSVC_SUFFIX}-${BOOST_DEBUG_SUFFIX}-${BOOST_VERSION}) debug libboost_program_options-vc${MSVC_SUFFIX}-${BOOST_DEBUG_SUFFIX}-${BOOST_VERSION})
set(Boost_REGEX_LIBRARY set(BOOST_REGEX_LIBRARY
optimized libboost_regex-vc${MSVC_SUFFIX}-${BOOST_OPTIM_SUFFIX}-${BOOST_VERSION} optimized libboost_regex-vc${MSVC_SUFFIX}-${BOOST_OPTIM_SUFFIX}-${BOOST_VERSION}
debug libboost_regex-vc${MSVC_SUFFIX}-${BOOST_DEBUG_SUFFIX}-${BOOST_VERSION}) debug libboost_regex-vc${MSVC_SUFFIX}-${BOOST_DEBUG_SUFFIX}-${BOOST_VERSION})
elseif (DARWIN) elseif (DARWIN)
set(Boost_FILESYSTEM_LIBRARY boost_filesystem) set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
set(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options) set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
set(Boost_REGEX_LIBRARY boost_regex) set(BOOST_REGEX_LIBRARY boost_regex-mt)
set(Boost_SYSTEM_LIBRARY boost_system) set(BOOST_SYSTEM_LIBRARY boost_system-mt)
elseif (LINUX) elseif (LINUX)
set(Boost_FILESYSTEM_LIBRARY boost_filesystem-mt) set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
set(Boost_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
set(Boost_REGEX_LIBRARY boost_regex-mt) set(BOOST_REGEX_LIBRARY boost_regex-mt)
set(Boost_SYSTEM_LIBRARY boost_system-mt) set(BOOST_SYSTEM_LIBRARY boost_system-mt)
endif (WINDOWS) endif (WINDOWS)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -1,45 +1,23 @@
# -*- cmake -*- # -*- cmake -*-
# Read version components from the header file. function (build_version _target)
file(STRINGS ${LIBS_OPEN_DIR}/llcommon/llversionviewer.h.in lines # Read version components from the header file.
REGEX " LL_VERSION_") file(STRINGS ${LIBS_OPEN_DIR}/llcommon/llversion${_target}.h lines
foreach(line ${lines}) REGEX " LL_VERSION_")
string(REGEX REPLACE ".*LL_VERSION_([A-Z]+).*" "\\1" comp "${line}") foreach(line ${lines})
string(REGEX REPLACE ".* = ([0-9]+);.*" "\\1" value "${line}") string(REGEX REPLACE ".*LL_VERSION_([A-Z]+).*" "\\1" comp "${line}")
set(v${comp} "${value}") string(REGEX REPLACE ".* = ([0-9]+);.*" "\\1" value "${line}")
endforeach(line) set(v${comp} "${value}")
endforeach(line)
execute_process( # Compose the version.
COMMAND git rev-list HEAD set(${_target}_VERSION "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}")
OUTPUT_VARIABLE GIT_REV_LIST_STR if (${_target}_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} message(STATUS "Version of ${_target} is ${${_target}_VERSION}")
OUTPUT_STRIP_TRAILING_WHITESPACE else (${_target}_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
) message(FATAL_ERROR "Could not determine ${_target} version (${${_target}_VERSION})")
endif (${_target}_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
if(GIT_REV_LIST_STR) # Report version to caller.
string(REPLACE "\n" ";" GIT_REV_LIST ${GIT_REV_LIST_STR}) set(${_target}_VERSION "${${_target}_VERSION}" PARENT_SCOPE)
else() endfunction (build_version)
string(REPLACE "\n" ";" GIT_REV_LIST "")
endif()
if(GIT_REV_LIST)
list(LENGTH GIT_REV_LIST vBUILD)
else()
set(vBUILD 99)
endif()
configure_file(
${CMAKE_SOURCE_DIR}/llcommon/llversionviewer.h.in
${CMAKE_SOURCE_DIR}/llcommon/llversionviewer.h
)
# Compose the version.
set(viewer_VERSION "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}")
if (viewer_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
message(STATUS "Version is ${viewer_VERSION}")
else (viewer_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
message(FATAL_ERROR "Could not determine version (${viewer_VERSION})")
endif (viewer_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
# Report version to caller.
#set(viewer_VERSION "${viewer_VERSION}" PARENT_SCOPE)

View File

@@ -10,7 +10,6 @@ if (STANDALONE)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(ares) use_prebuilt_binary(ares)
if (WINDOWS) if (WINDOWS)
add_definitions("-DCARES_STATICLIB")
set(CARES_LIBRARIES areslib) set(CARES_LIBRARIES areslib)
elseif (DARWIN) elseif (DARWIN)
set(CARES_LIBRARIES set(CARES_LIBRARIES

View File

@@ -29,19 +29,19 @@ set(cmake_SOURCE_FILES
FindELFIO.cmake FindELFIO.cmake
FindGooglePerfTools.cmake FindGooglePerfTools.cmake
FindHunSpell.cmake FindHunSpell.cmake
FindMono.cmake
FindMT.cmake FindMT.cmake
FindMySQL.cmake
FindNDOF.cmake FindNDOF.cmake
FindOpenJPEG.cmake FindOpenJPEG.cmake
FindXmlRpcEpi.cmake FindXmlRpcEpi.cmake
FMOD.cmake FMOD.cmake
FMODEX.cmake
FreeType.cmake FreeType.cmake
GStreamer010Plugin.cmake GStreamer010Plugin.cmake
GooglePerfTools.cmake GooglePerfTools.cmake
Hunspell.cmake HUNSPELL.cmake
JPEG.cmake JPEG.cmake
LLAddBuildTest.cmake LLAddBuildTest.cmake
LLAppearance.cmake
LLAudio.cmake LLAudio.cmake
LLCharacter.cmake LLCharacter.cmake
LLCommon.cmake LLCommon.cmake
@@ -55,15 +55,16 @@ set(cmake_SOURCE_FILES
LLMessage.cmake LLMessage.cmake
LLPlugin.cmake LLPlugin.cmake
LLPrimitive.cmake LLPrimitive.cmake
LLQtWebkit.cmake
LLRender.cmake LLRender.cmake
LLScene.cmake LLScene.cmake
LLUI.cmake LLUI.cmake
LLVFS.cmake LLVFS.cmake
LLWindow.cmake LLWindow.cmake
LLXML.cmake LLXML.cmake
# LScript.cmake LScript.cmake
Linking.cmake Linking.cmake
MonoEmbed.cmake
MySQL.cmake
NDOF.cmake NDOF.cmake
OPENAL.cmake OPENAL.cmake
OpenGL.cmake OpenGL.cmake
@@ -72,17 +73,21 @@ set(cmake_SOURCE_FILES
PNG.cmake PNG.cmake
Python.cmake Python.cmake
Prebuilt.cmake Prebuilt.cmake
Qt4.cmake
RunBuildTest.cmake RunBuildTest.cmake
TemplateCheck.cmake TemplateCheck.cmake
Tut.cmake Tut.cmake
UI.cmake UI.cmake
UnixInstall.cmake UnixInstall.cmake
Variables.cmake Variables.cmake
Versions.cmake
XmlRpcEpi.cmake XmlRpcEpi.cmake
ZLIB.cmake ZLIB.cmake
) )
if(FMODEX)
list(APPEND cmake_SOURCE_FILES FMODEX.cmake)
endif(FMODEX)
source_group("Shared Rules" FILES ${cmake_SOURCE_FILES}) source_group("Shared Rules" FILES ${cmake_SOURCE_FILES})
set(master_SOURCE_FILES set(master_SOURCE_FILES

View File

@@ -1,7 +1,7 @@
# -*- cmake -*- # -*- cmake -*-
include(Prebuilt) include(Prebuilt)
set(CURL_FIND_QUIETLY OFF) set(CURL_FIND_QUIETLY ON)
set(CURL_FIND_REQUIRED ON) set(CURL_FIND_REQUIRED ON)
if (STANDALONE) if (STANDALONE)
@@ -14,9 +14,6 @@ else (STANDALONE)
optimized libcurl) optimized libcurl)
else (WINDOWS) else (WINDOWS)
set(CURL_LIBRARIES curl) set(CURL_LIBRARIES curl)
if(LINUX AND WORD_SIZE EQUAL 64)
list(APPEND CURL_LIBRARIES idn)
endif(LINUX AND WORD_SIZE EQUAL 64)
endif (WINDOWS) endif (WINDOWS)
set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -29,8 +29,6 @@ set(debug_files
libapr-1.dll libapr-1.dll
libaprutil-1.dll libaprutil-1.dll
libapriconv-1.dll libapriconv-1.dll
libeay32.dll
ssleay32.dll
) )
copy_if_different( copy_if_different(
@@ -45,6 +43,10 @@ set(all_targets ${all_targets} ${out_targets})
set(plugintest_debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug") set(plugintest_debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/debug")
set(plugintest_debug_files set(plugintest_debug_files
libeay32.dll libeay32.dll
libglib-2.0-0.dll
libgmodule-2.0-0.dll
libgobject-2.0-0.dll
libgthread-2.0-0.dll
qtcored4.dll qtcored4.dll
qtguid4.dll qtguid4.dll
qtnetworkd4.dll qtnetworkd4.dll
@@ -90,6 +92,11 @@ set(all_targets ${all_targets} ${out_targets})
set(plugintest_release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release") set(plugintest_release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-win32/lib/release")
set(plugintest_release_files set(plugintest_release_files
libeay32.dll libeay32.dll
libglib-2.0-0.dll
libgmodule-2.0-0.dll
libgobject-2.0-0.dll
libgthread-2.0-0.dll
# llkdu.dll (not required for plugin test)
qtcore4.dll qtcore4.dll
qtgui4.dll qtgui4.dll
qtnetwork4.dll qtnetwork4.dll
@@ -105,6 +112,14 @@ copy_if_different(
) )
set(all_targets ${all_targets} ${out_targets}) set(all_targets ${all_targets} ${out_targets})
copy_if_different(
${plugintest_release_src_dir}
"${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/ReleaseSSE2"
out_targets
${plugintest_release_files}
)
set(all_targets ${all_targets} ${out_targets})
copy_if_different( copy_if_different(
${plugintest_release_src_dir} ${plugintest_release_src_dir}
"${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/RelWithDebInfo" "${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/RelWithDebInfo"
@@ -131,6 +146,14 @@ copy_if_different(
) )
set(all_targets ${all_targets} ${out_targets}) set(all_targets ${all_targets} ${out_targets})
copy_if_different(
${plugintest_release_src_dir}
"${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/ReleaseSSE2/imageformats"
out_targets
${plugintest_release_files}
)
set(all_targets ${all_targets} ${out_targets})
copy_if_different( copy_if_different(
${plugintest_release_src_dir} ${plugintest_release_src_dir}
"${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/RelWithDebInfo/imageformats" "${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/RelWithDebInfo/imageformats"
@@ -147,6 +170,14 @@ copy_if_different(
) )
set(all_targets ${all_targets} ${out_targets}) set(all_targets ${all_targets} ${out_targets})
copy_if_different(
${plugintest_release_src_dir}
"${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2/llplugin/imageformats"
out_targets
${plugintest_release_files}
)
set(all_targets ${all_targets} ${out_targets})
copy_if_different( copy_if_different(
${plugintest_release_src_dir} ${plugintest_release_src_dir}
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llplugin/imageformats" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llplugin/imageformats"
@@ -193,6 +224,14 @@ copy_if_different(
) )
set(all_targets ${all_targets} ${out_targets}) set(all_targets ${all_targets} ${out_targets})
copy_if_different(
${plugins_release_src_dir}
"${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2/llplugin"
out_targets
${plugins_release_files}
)
set(all_targets ${all_targets} ${out_targets})
copy_if_different( copy_if_different(
${plugins_release_src_dir} ${plugins_release_src_dir}
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llplugin" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llplugin"
@@ -208,44 +247,46 @@ set(release_files
libapr-1.dll libapr-1.dll
libaprutil-1.dll libaprutil-1.dll
libapriconv-1.dll libapriconv-1.dll
libeay32.dll
ssleay32.dll
) )
if(FMODEX) if(FMODEX)
find_path(FMODEX_BINARY_DIR fmodex.dll find_path(FMODEX_BINARY_DIR fmodex.dll
${release_src_dir} ${release_src_dir}
${FMODEX_SDK_DIR}/api ${FMODEX_SDK_DIR}/api
${FMODEX_SDK_DIR} ${FMODEX_SDK_DIR}
) )
if(FMODEX_BINARY_DIR) if(FMODEX_BINARY_DIR)
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets fmodex.dll) copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets fmodex.dll)
set(all_targets ${all_targets} ${out_targets}) set(all_targets ${all_targets} ${out_targets})
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets fmodex.dll) copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2" out_targets fmodex.dll)
set(all_targets ${all_targets} ${out_targets}) set(all_targets ${all_targets} ${out_targets})
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Debug" out_targets fmodex.dll) copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets fmodex.dll)
set(all_targets ${all_targets} ${out_targets}) set(all_targets ${all_targets} ${out_targets})
endif(FMODEX_BINARY_DIR) copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Debug" out_targets fmodex.dll)
set(all_targets ${all_targets} ${out_targets})
endif(FMODEX_BINARY_DIR)
endif(FMODEX) endif(FMODEX)
if(FMOD) if(FMOD)
find_path(FMOD_BINARY_DIR fmod.dll find_path(FMOD_BINARY_DIR fmod.dll
${release_src_dir} ${release_src_dir}
${FMOD_SDK_DIR}/api ${FMOD_SDK_DIR}/api
${FMOD_SDK_DIR} ${FMOD_SDK_DIR}
) )
if(FMOD_BINARY_DIR) if(FMOD_BINARY_DIR)
copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets fmod.dll) copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets fmod.dll)
set(all_targets ${all_targets} ${out_targets}) set(all_targets ${all_targets} ${out_targets})
copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets fmod.dll) copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2" out_targets fmod.dll)
set(all_targets ${all_targets} ${out_targets}) set(all_targets ${all_targets} ${out_targets})
copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Debug" out_targets fmod.dll) copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets fmod.dll)
set(all_targets ${all_targets} ${out_targets}) set(all_targets ${all_targets} ${out_targets})
else(FMOD_BINARY_DIR) copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Debug" out_targets fmod.dll)
list(APPEND release_files fmod.dll) #Required for compile. This will cause an error in copying binaries. set(all_targets ${all_targets} ${out_targets})
endif(FMOD_BINARY_DIR) else(FMOD_BINARY_DIR)
list(APPEND release_files fmod.dll) #Required for compile. This will cause an error in copying binaries.
endif(FMOD_BINARY_DIR)
endif(FMOD) endif(FMOD)
copy_if_different( copy_if_different(
@@ -264,6 +305,22 @@ copy_if_different(
) )
set(all_targets ${all_targets} ${out_targets}) set(all_targets ${all_targets} ${out_targets})
copy_if_different(
${release_src_dir}
"${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2"
out_targets
${release_files}
)
set(all_targets ${all_targets} ${out_targets})
copy_if_different(
${vivox_src_dir}
"${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2"
out_targets
${vivox_files}
)
set(all_targets ${all_targets} ${out_targets})
copy_if_different( copy_if_different(
${release_src_dir} ${release_src_dir}
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
@@ -314,6 +371,15 @@ else(EXISTS ${internal_llkdu_path})
COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/Release" COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/Release"
) )
set(all_targets ${all_targets} ${release_llkdu_dst}) set(all_targets ${all_targets} ${release_llkdu_dst})
set(releasesse2_llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2/llkdu.dll")
ADD_CUSTOM_COMMAND(
OUTPUT ${releasesse2_llkdu_dst}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${release_llkdu_src} ${releasesse2_llkdu_dst}
DEPENDS ${release_llkdu_src}
COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2"
)
set(all_targets ${all_targets} ${releasesse2_llkdu_dst})
set(relwithdebinfo_llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llkdu.dll") set(relwithdebinfo_llkdu_dst "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llkdu.dll")
ADD_CUSTOM_COMMAND( ADD_CUSTOM_COMMAND(
@@ -389,6 +455,14 @@ if (MSVC80)
) )
set(all_targets ${all_targets} ${out_targets}) set(all_targets ${all_targets} ${out_targets})
copy_if_different(
${release_msvc8_redist_path}
"${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2"
out_targets
${release_msvc8_files}
)
set(all_targets ${all_targets} ${out_targets})
copy_if_different( copy_if_different(
${release_msvc8_redist_path} ${release_msvc8_redist_path}
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
@@ -409,6 +483,19 @@ if (MSVC80)
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Release/Microsoft.VC80.CRT.manifest DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Release/Microsoft.VC80.CRT.manifest
COMMENT "Creating release app config file" COMMENT "Creating release app config file"
) )
set(releasesse2_appconfig_file ${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2/${VIEWER_BINARY_NAME}.exe.config)
add_custom_command(
OUTPUT ${releasesse2_appconfig_file}
COMMAND ${PYTHON_EXECUTABLE}
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/build_win32_appConfig.py
${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2/Microsoft.VC80.CRT.manifest
${CMAKE_CURRENT_SOURCE_DIR}/SecondLife.exe.config
${releasesse2_appconfig_file}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2/Microsoft.VC80.CRT.manifest
COMMENT "Creating release-sse2 app config file"
)
set(relwithdebinfo_appconfig_file ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/${VIEWER_BINARY_NAME}.exe.config) set(relwithdebinfo_appconfig_file ${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/${VIEWER_BINARY_NAME}.exe.config)
add_custom_command( add_custom_command(
@@ -430,6 +517,7 @@ add_custom_target(copy_win_libs ALL
DEPENDS DEPENDS
${all_targets} ${all_targets}
${release_appconfig_file} ${release_appconfig_file}
${releasesse2_appconfig_file}
${relwithdebinfo_appconfig_file} ${relwithdebinfo_appconfig_file}
${debug_appconfig_file} ${debug_appconfig_file}
) )

View File

@@ -1,18 +1 @@
include_directories (${CMAKE_SOURCE_DIR}/cwdebug) set(CWDEBUG_LIBRARIES cwdebug)
set(cwdebug_SOURCE_FILES
${CMAKE_SOURCE_DIR}/cwdebug/debug.cc
)
set(cwdebug_HEADER_FILES
${CMAKE_SOURCE_DIR}/cwdebug/cwdebug.h
${CMAKE_SOURCE_DIR}/cwdebug/sys.h
${CMAKE_SOURCE_DIR}/cwdebug/debug.h
${CMAKE_SOURCE_DIR}/cwdebug/debug_ostream_operators.h
)
set_source_files_properties(${cwdebug_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
list(APPEND cwdebug_SOURCE_FILES ${cwdebug_HEADER_FILES})

View File

@@ -7,14 +7,15 @@ if (STANDALONE)
pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1) pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1)
elseif (LINUX) elseif (LINUX)
use_prebuilt_binary(glib) # dbusglib needs glib
use_prebuilt_binary(dbusglib) use_prebuilt_binary(dbusglib)
set(DBUSGLIB_FOUND ON FORCE BOOL) set(DBUSGLIB_FOUND ON FORCE BOOL)
set(DBUSGLIB_INCLUDE_DIRS set(DBUSGLIB_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/dbus ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/glib-2.0
) )
# We don't need to explicitly link against dbus-glib itself, because
# the viewer probes for the system's copy at runtime.
set(DBUSGLIB_LIBRARIES set(DBUSGLIB_LIBRARIES
dbus-glib-1
gobject-2.0 gobject-2.0
glib-2.0 glib-2.0
) )

View File

@@ -3,7 +3,7 @@
if (VIEWER AND WINDOWS) if (VIEWER AND WINDOWS)
find_path(DIRECTX_INCLUDE_DIR dxdiag.h find_path(DIRECTX_INCLUDE_DIR dxdiag.h
"$ENV{DXSDK_DIR}/Include" "$ENV{DXSDK_DIR}/Include"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Include" "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Include"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Include" "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Include"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Include" "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Include"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Include" "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Include"
@@ -25,7 +25,7 @@ if (VIEWER AND WINDOWS)
find_path(DIRECTX_LIBRARY_DIR dxguid.lib find_path(DIRECTX_LIBRARY_DIR dxguid.lib
"$ENV{DXSDK_DIR}/Lib/x86" "$ENV{DXSDK_DIR}/Lib/x86"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Lib/x86" "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2010)/Lib/x86"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Lib/x86" "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (March 2009)/Lib/x86"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Lib/x86" "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (August 2008)/Lib/x86"
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Lib/x86" "$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Lib/x86"

View File

@@ -8,7 +8,7 @@ if (STANDALONE)
elseif (LINUX) elseif (LINUX)
use_prebuilt_binary(elfio) use_prebuilt_binary(elfio)
set(ELFIO_LIBRARIES ELFIO) set(ELFIO_LIBRARIES ELFIO)
set(ELFIO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) set(ELFIO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
set(ELFIO_FOUND "YES") set(ELFIO_FOUND "YES")
endif (STANDALONE) endif (STANDALONE)

View File

@@ -13,5 +13,5 @@ else (STANDALONE)
else (WINDOWS) else (WINDOWS)
set(EXPAT_LIBRARIES expat) set(EXPAT_LIBRARIES expat)
endif (WINDOWS) endif (WINDOWS)
set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -7,13 +7,26 @@ if(INSTALL_PROPRIETARY)
use_prebuilt_binary(fmod) use_prebuilt_binary(fmod)
endif(INSTALL_PROPRIETARY) endif(INSTALL_PROPRIETARY)
find_library(FMOD_LIBRARY find_library(FMOD_LIBRARY_RELEASE
NAMES fmod fmodvc fmod-3.75 NAMES fmod fmodvc fmod-3.75
PATHS PATHS
optimized ${ARCH_PREBUILT_DIRS_RELEASE} ${ARCH_PREBUILT_DIRS_RELEASE}
debug ${ARCH_PREBUILT_DIRS_DEBUG}
) )
find_library(FMOD_LIBRARY_DEBUG
NAMES fmod fmodvc fmod-3.75
PATHS
${ARCH_PREBUILT_DIRS_DEBUG}
)
if (FMOD_LIBRARY_RELEASE AND FMOD_LIBRARY_DEBUG)
set(FMOD_LIBRARY
debug ${FMOD_LIBRARY_DEBUG}
optimized ${FMOD_LIBRARY_RELEASE})
elseif (FMOD_LIBRARY_RELEASE)
set(FMOD_LIBRARY ${FMOD_LIBRARY_RELEASE})
endif (FMOD_LIBRARY_RELEASE AND FMOD_LIBRARY_DEBUG)
if (NOT FMOD_LIBRARY) if (NOT FMOD_LIBRARY)
set(FMOD_SDK_DIR CACHE PATH "Path to the FMOD SDK.") set(FMOD_SDK_DIR CACHE PATH "Path to the FMOD SDK.")
if (FMOD_SDK_DIR) if (FMOD_SDK_DIR)

View File

@@ -2,59 +2,70 @@
include(Linking) include(Linking)
if(INSTALL_PROPRIETARY)
include(Prebuilt)
use_prebuilt_binary(fmodex)
endif(INSTALL_PROPRIETARY)
find_library(FMODEX_LIBRARY_RELEASE
NAMES fmodex fmodex_vc fmodexL_vc
PATHS
${ARCH_PREBUILT_DIRS_RELEASE}
)
find_library(FMODEX_LIBRARY_DEBUG
NAMES fmodex fmodex_vc fmodexL_vc
PATHS
${ARCH_PREBUILT_DIRS_DEBUG}
)
if (FMODEX_LIBRARY_RELEASE AND FMODEX_LIBRARY_DEBUG)
set(FMODEX_LIBRARY
debug ${FMODEX_LIBRARY_DEBUG}
optimized ${FMODEX_LIBRARY_RELEASE})
elseif (FMODEX_LIBRARY_RELEASE)
set(FMODEX_LIBRARY ${FMODEX_LIBRARY_RELEASE})
endif (FMODEX_LIBRARY_RELEASE AND FMODEX_LIBRARY_DEBUG)
if (NOT FMODEX_LIBRARY) if (NOT FMODEX_LIBRARY)
set(FMODEX_SDK_DIR CACHE PATH "Path to the FMOD Ex SDK.") set(FMODEX_SDK_DIR CACHE PATH "Path to the FMOD Ex SDK.")
if (FMODEX_SDK_DIR) if (FMODEX_SDK_DIR)
if(WORD_SIZE EQUAL 32) find_library(FMODEX_LIBRARY
find_library(FMODEX_LIBRARY fmodex fmodex_vc fmodexL_vc
fmodex_vc fmodexL_vc fmodex fmodexL PATHS
PATHS ${FMODEX_SDK_DIR}/api/lib
"${FMODEX_SDK_DIR}/api/lib" ${FMODEX_SDK_DIR}/api
"${FMODEX_SDK_DIR}/api" ${FMODEX_SDK_DIR}/lib
"${FMODEX_SDK_DIR}/lib" ${FMODEX_SDK_DIR}
"${FMODEX_SDK_DIR}" )
)
elseif(WORD_SIZE EQUAL 64)
find_library(FMODEX_LIBRARY
fmodex64 fmodexL64
PATHS
"${FMODEX_SDK_DIR}/api/lib"
"${FMODEX_SDK_DIR}/api"
"${FMODEX_SDK_DIR}/lib"
"${FMODEX_SDK_DIR}"
)
endif(WORD_SIZE EQUAL 32)
endif(FMODEX_SDK_DIR) endif(FMODEX_SDK_DIR)
if(WINDOWS AND NOT FMODEX_LIBRARY) if(WINDOWS AND NOT FMODEX_LIBRARY)
set(FMODEX_PROG_DIR "$ENV{PROGRAMFILES}/FMOD SoundSystem/FMOD Programmers API Windows") set(FMODEX_PROG_DIR "$ENV{PROGRAMFILES}/FMOD SoundSystem/FMOD Programmers API Windows")
find_library(FMODEX_LIBRARY find_library(FMODEX_LIBRARY
fmodex_vc fmodexL_vc fmodex_vc fmodexL_vc
PATHS PATHS
"${FMODEX_PROG_DIR}/api/lib" ${FMODEX_PROG_DIR}/api/lib
"${FMODEX_PROG_DIR}/api" ${FMODEX_PROG_DIR}/api
"${FMODEX_PROG_DIR}" ${FMODEX_PROG_DIR}
) )
if(FMODEX_LIBRARY) if(FMODEX_LIBRARY)
message(STATUS "Found fmodex in ${FMODEX_PROG_DIR}") message(STATUS "Found fmodex in ${FMODEX_PROG_DIR}")
set(FMODEX_SDK_DIR "${FMODEX_PROG_DIR}") set(FMODEX_SDK_DIR ${FMODEX_PROG_DIR})
set(FMODEX_SDK_DIR "${FMODEX_PROG_DIR}" CACHE PATH "Path to the FMOD Ex SDK." FORCE) set(FMODEX_SDK_DIR ${FMODEX_PROG_DIR} CACHE PATH "Path to the FMOD Ex SDK." FORCE)
endif(FMODEX_LIBRARY) endif(FMODEX_LIBRARY)
endif(WINDOWS AND NOT FMODEX_LIBRARY) endif(WINDOWS AND NOT FMODEX_LIBRARY)
endif (NOT FMODEX_LIBRARY) endif (NOT FMODEX_LIBRARY)
find_path(FMODEX_INCLUDE_DIR fmod.hpp find_path(FMODEX_INCLUDE_DIR fmod.h
"${LIBS_PREBUILT_DIR}/include/fmodex" ${LIBS_PREBUILT_DIR}/include/fmodex
"${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/fmodex" ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/fmodex
"${FMODEX_SDK_DIR}/api/inc" ${FMODEX_SDK_DIR}/api/inc
"${FMODEX_SDK_DIR}/inc" ${FMODEX_SDK_DIR}/inc
"${FMODEX_SDK_DIR}" ${FMODEX_SDK_DIR}
) )
if(DARWIN)
set(FMODEX_ORIG_LIBRARY "${FMODEX_LIBRARY}")
set(FMODEX_LIBRARY "${CMAKE_CURRENT_BINARY_DIR}/libfmodex.dylib")
endif(DARWIN)
if (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR) if (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)
set(FMODEX ON CACHE BOOL "Use closed source FMOD Ex sound library.") set(FMODEX ON CACHE BOOL "Use closed source FMOD Ex sound library.")
else (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR) else (FMODEX_LIBRARY AND FMODEX_INCLUDE_DIR)

View File

@@ -5,7 +5,7 @@ FIND_PATH(HUNSPELL_INCLUDE_DIR hunspell.hxx
/usr/include /usr/include
) )
SET(HUNSPELL_NAMES ${HUNSPELL_NAMES} hunspell hunspell-1.2 hunspell-1.3) SET(HUNSPELL_NAMES ${HUNSPELL_NAMES} hunspell hunspell-1.2)
FIND_LIBRARY(HUNSPELL_LIBRARY FIND_LIBRARY(HUNSPELL_LIBRARY
NAMES ${HUNSPELL_NAMES} NAMES ${HUNSPELL_NAMES}
PATHS /usr/lib /usr/local/lib PATHS /usr/lib /usr/local/lib

View File

@@ -3,18 +3,16 @@
# - Find JSONCpp # - Find JSONCpp
# Find the JSONCpp includes and library # Find the JSONCpp includes and library
# This module defines # This module defines
# JSONCPP_FOUND, System has libjsoncpp. # JSONCPP_INCLUDE_DIR, where to find json.h, etc.
# JSONCPP_INCLUDE_DIRS - The libjsoncpp include directories. # JSONCPP_LIBRARIES, the libraries needed to use jsoncpp.
# JSONCPP_LIBRARIES - The libraries needed to use libjsoncpp. # JSONCPP_FOUND, If false, do not try to use jsoncpp.
# JSONCPP_DEFINITIONS - Compiler switches required for using libjsoncpp. # also defined, but not for general use are
# JSONCPP_LIBRARY, where to find the jsoncpp library.
FIND_PACKAGE(PkgConfig) FIND_PATH(JSONCPP_INCLUDE_DIR jsoncpp/json.h
PKG_CHECK_MODULES(PC_JSONCPP jsoncpp) /usr/local/include
SET(JSONCPP_DEFINITIONS ${PC_JSONCPP_CFLAGS_OTHER}) /usr/include
)
FIND_PATH(JSONCPP_INCLUDE_DIR json/reader.h
HINTS ${PC_JSONCPP_INCLUDE_DIR} ${PC_JSONCPP_INCLUDE_DIRS}
PATH_SUFFIXES jsoncpp)
# Get the GCC compiler version # Get the GCC compiler version
EXEC_PROGRAM(${CMAKE_CXX_COMPILER} EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
@@ -24,16 +22,39 @@ EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
) )
# Try to find a library that was compiled with the same compiler version as we currently use. # Try to find a library that was compiled with the same compiler version as we currently use.
SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson_linux-gcc-${_gcc_COMPILER_VERSION}_libmt.so)
IF (STANDALONE)
# On standalone, assume that the system installed library was compiled with the used compiler.
SET(JSONCPP_NAMES ${JSONCPP_NAMES} libjson.so)
ENDIF (STANDALONE)
FIND_LIBRARY(JSONCPP_LIBRARY FIND_LIBRARY(JSONCPP_LIBRARY
NAMES libjson_linux-gcc-${_gcc_COMPILER_VERSION}_libmt.so libjsoncpp.so NAMES ${JSONCPP_NAMES}
HINTS ${PC_JSONCPP_LIBDIR} ${PC_JSONCPP_LIBRARY_DIRS} PATHS /usr/lib /usr/local/lib
PATHS /usr/lib /usr/local/lib) )
SET(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY}) IF (JSONCPP_LIBRARY AND JSONCPP_INCLUDE_DIR)
SET(JSONCPP_INCLUDE_DIRS ${JSONCPP_INCLUDE_DIR}) SET(JSONCPP_LIBRARIES ${JSONCPP_LIBRARY})
SET(JSONCPP_FOUND "YES")
ELSE (JSONCPP_LIBRARY AND JSONCPP_INCLUDE_DIR)
SET(JSONCPP_FOUND "NO")
ENDIF (JSONCPP_LIBRARY AND JSONCPP_INCLUDE_DIR)
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(JSONCPP DEFAULT_MSG
JSONCPP_LIBRARY JSONCPP_INCLUDE_DIR)
MARK_AS_ADVANCED(JSONCPP_LIBRARY JSONCPP_INCLUDE_DIR) IF (JSONCPP_FOUND)
IF (NOT JSONCPP_FIND_QUIETLY)
MESSAGE(STATUS "Found JSONCpp: ${JSONCPP_LIBRARIES}")
ENDIF (NOT JSONCPP_FIND_QUIETLY)
ELSE (JSONCPP_FOUND)
IF (JSONCPP_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find JSONCpp library")
ENDIF (JSONCPP_FIND_REQUIRED)
ENDIF (JSONCPP_FOUND)
# Deprecated declarations.
SET (NATIVE_JSONCPP_INCLUDE_PATH ${JSONCPP_INCLUDE_DIR} )
GET_FILENAME_COMPONENT (NATIVE_JSONCPP_LIB_PATH ${JSONCPP_LIBRARY} PATH)
MARK_AS_ADVANCED(
JSONCPP_LIBRARY
JSONCPP_INCLUDE_DIR
)

View File

@@ -35,7 +35,7 @@ find_path(LLQTWEBKIT_INCLUDE_DIR llqtwebkit.h NO_SYSTEM_ENVIRONMENT_PATH HINTS $
find_library(LLQTWEBKIT_LIBRARY NAMES llqtwebkit NO_SYSTEM_ENVIRONMENT_PATH HINTS ${LLQTWEBKIT_LIBRARY_DIRS}) find_library(LLQTWEBKIT_LIBRARY NAMES llqtwebkit NO_SYSTEM_ENVIRONMENT_PATH HINTS ${LLQTWEBKIT_LIBRARY_DIRS})
if (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND) # If pkg-config couldn't find it, pretend we don't have pkg-config. if (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND) # If pkg-config couldn't find it, pretend we don't have pkg-config.
set(LLQTWEBKIT_LIBRARIES llqtwebkit) set(LLQTWEBKIT_LIBRARIES llqtwebkit)
get_filename_component(LLQTWEBKIT_LIBRARY_DIRS ${LLQTWEBKIT_LIBRARY} PATH) get_filename_component(LLQTWEBKIT_LIBRARY_DIRS ${LLQTWEBKIT_LIBRARY} PATH)
endif (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND) endif (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND)

View File

@@ -1,17 +1,17 @@
#Find the windows manifest tool. #Find the windows manifest tool.
if (MSVC80) if (MSVC80)
FIND_PROGRAM(HAVE_MANIFEST_TOOL NAMES mt FIND_PROGRAM(HAVE_MANIFEST_TOOL NAMES mt
PATHS PATHS
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/VC/bin" "$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/VC/bin"
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin" "$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin"
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/SDK/v2.0/Bin") "$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/SDK/v2.0/Bin")
IF(HAVE_MANIFEST_TOOL) IF(HAVE_MANIFEST_TOOL)
MESSAGE(STATUS "Found Mainfest Tool. Embedding custom manifests.") MESSAGE(STATUS "Found Mainfest Tool. Embedding custom manifests.")
ELSE(HAVE_MANIFEST_TOOL) ELSE(HAVE_MANIFEST_TOOL)
MESSAGE(FATAL_ERROR "Manifest tool, mt.exe, can't be found.") MESSAGE(FATAL_ERROR "Manifest tool, mt.exe, can't be found.")
ENDIF(HAVE_MANIFEST_TOOL) ENDIF(HAVE_MANIFEST_TOOL)
STRING(REPLACE "/MANIFEST " "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS STRING(REPLACE "/MANIFEST " "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
${CMAKE_EXE_LINKER_FLAGS}) ${CMAKE_EXE_LINKER_FLAGS})
endif (MSVC80) endif (MSVC80)

View File

@@ -0,0 +1,68 @@
# - Try to find the mono, mcs, gmcs and gacutil
#
# defines
#
# MONO_FOUND - system has mono, mcs, gmcs and gacutil
# MONO_PATH - where to find 'mono'
# MCS_PATH - where to find 'mcs'
# GMCS_PATH - where to find 'gmcs'
# GACUTIL_PATH - where to find 'gacutil'
#
# copyright (c) 2007 Arno Rehn arno@arnorehn.de
#
# Redistribution and use is allowed according to the terms of the GPL license.
# Removed the check for gmcs
FIND_PROGRAM (MONO_EXECUTABLE mono
"$ENV{PROGRAMFILES}/Mono-1.9.1/bin"
"$ENV{PROGRAMFILES}/Mono-1.2.6/bin"
/bin
/usr/bin
/usr/local/bin
)
FIND_PROGRAM (MCS_EXECUTABLE mcs
"$ENV{PROGRAMFILES}/Mono-1.9.1/bin"
"$ENV{PROGRAMFILES}/Mono-1.2.6/bin"
/bin
/usr/bin
/usr/local/bin
)
FIND_PROGRAM (GMCS_EXECUTABLE gmcs
"$ENV{PROGRAMFILES}/Mono-1.9.1/bin"
"$ENV{PROGRAMFILES}/Mono-1.2.6/bin"
/bin
/usr/bin
/usr/local/bin
)
FIND_PROGRAM (GACUTIL_EXECUTABLE gacutil
"$ENV{PROGRAMFILES}/Mono-1.9.1/bin"
"$ENV{PROGRAMFILES}/Mono-1.2.6/bin"
/bin
/usr/bin
/usr/local/bin
)
FIND_PROGRAM (ILASM_EXECUTABLE
ilasm
NO_DEFAULT_PATH
PATHS "$ENV{PROGRAMFILES}/Mono-1.9.1/bin" "$ENV{PROGRAMFILES}/Mono-1.2.6/bin" /bin /usr/bin /usr/local/bin
)
SET (MONO_FOUND FALSE)
IF (MONO_EXECUTABLE AND MCS_EXECUTABLE AND GACUTIL_EXECUTABLE)
SET (MONO_FOUND TRUE)
ENDIF (MONO_EXECUTABLE AND MCS_EXECUTABLE AND GACUTIL_EXECUTABLE)
IF (MONO_FOUND)
IF (NOT Mono_FIND_QUIETLY)
MESSAGE(STATUS "Found mono: ${MONO_EXECUTABLE}")
MESSAGE(STATUS "Found mcs: ${MCS_EXECUTABLE}")
MESSAGE(STATUS "Found gacutil: ${GACUTIL_EXECUTABLE}")
ENDIF (NOT Mono_FIND_QUIETLY)
ELSE (MONO_FOUND)
IF (Mono_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find one or more of the following programs: mono, mcs, gacutil")
ENDIF (Mono_FIND_REQUIRED)
ENDIF (MONO_FOUND)
MARK_AS_ADVANCED(MONO_EXECUTABLE MCS_EXECUTABLE GACUTIL_EXECUTABLE)

View File

@@ -0,0 +1,48 @@
# -*- cmake -*-
# - Find MySQL
# Find the MySQL includes and library
# This module defines
# MYSQL_INCLUDE_DIR, where to find mysql.h, etc.
# MYSQL_LIBRARIES, the libraries needed to use Mysql.
# MYSQL_FOUND, If false, do not try to use Mysql.
# also defined, but not for general use are
# MYSQL_LIBRARY, where to find the Mysql library.
FIND_PATH(MYSQL_INCLUDE_DIR mysql/mysql.h
/usr/local/include
/usr/include
)
SET(MYSQL_NAMES ${MYSQL_NAMES} mysqlclient)
FIND_LIBRARY(MYSQL_LIBRARY
NAMES ${MYSQL_NAMES}
PATHS /usr/lib/mysql /usr/lib /usr/local/lib/mysql /usr/local/lib
)
IF (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR)
SET(MYSQL_LIBRARIES ${MYSQL_LIBRARY})
SET(MYSQL_FOUND "YES")
ELSE (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR)
SET(MYSQL_FOUND "NO")
ENDIF (MYSQL_LIBRARY AND MYSQL_INCLUDE_DIR)
IF (MYSQL_FOUND)
IF (NOT MYSQL_FIND_QUIETLY)
MESSAGE(STATUS "Found MySQL: ${MYSQL_LIBRARIES}")
ENDIF (NOT MYSQL_FIND_QUIETLY)
ELSE (MYSQL_FOUND)
IF (MYSQL_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find MySQL library")
ENDIF (MYSQL_FIND_REQUIRED)
ENDIF (MYSQL_FOUND)
# Deprecated declarations.
SET (NATIVE_MYSQL_INCLUDE_PATH ${MYSQL_INCLUDE_DIR} )
GET_FILENAME_COMPONENT (NATIVE_MYSQL_LIB_PATH ${MYSQL_LIBRARY} PATH)
MARK_AS_ADVANCED(
MYSQL_LIBRARY
MYSQL_INCLUDE_DIR
)

View File

@@ -11,7 +11,7 @@ else (STANDALONE)
set(FREETYPE_INCLUDE_DIRS set(FREETYPE_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
else (LINUX) else (LINUX)
set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (LINUX) endif (LINUX)
set(FREETYPE_LIBRARIES freetype) set(FREETYPE_LIBRARIES freetype)

View File

@@ -1,20 +1,16 @@
# -*- cmake -*- # -*- cmake -*-
include(Prebuilt) include(Prebuilt)
if(WORD_SIZE EQUAL 64)
set(DISABLE_TCMALLOC TRUE)
endif(WORD_SIZE EQUAL 64)
if (STANDALONE) if (STANDALONE)
include(FindGooglePerfTools) include(FindGooglePerfTools)
else (STANDALONE) else (STANDALONE)
if (LINUX OR WINDOWS AND NOT WORD_SIZE EQUAL 64) if (LINUX OR WINDOWS)
use_prebuilt_binary(gperftools) use_prebuilt_binary(google)
endif (LINUX OR WINDOWS AND NOT WORD_SIZE EQUAL 64) endif (LINUX OR WINDOWS)
if (WINDOWS AND NOT DISABLE_TCMALLOC) if (WINDOWS)
set(TCMALLOC_LIBRARIES libtcmalloc_minimal.lib) set(TCMALLOC_LIBRARIES libtcmalloc_minimal.lib)
set(TCMALLOC_LINKER_FLAGS "/INCLUDE:\"__tcmalloc\"") set(TCMALLOC_LINKER_FLAGS "/INCLUDE:\"__tcmalloc\"")
endif (WINDOWS AND NOT DISABLE_TCMALLOC) endif (WINDOWS)
if (LINUX) if (LINUX)
if(USE_GOOGLE_PERFTOOLS) if(USE_GOOGLE_PERFTOOLS)
set(TCMALLOC_LIBRARIES tcmalloc) set(TCMALLOC_LIBRARIES tcmalloc)

View File

@@ -0,0 +1,16 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
include(FindHunSpell)
else (STANDALONE)
use_prebuilt_binary(hunspell)
set(HUNSPELL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/hunspell)
if (LINUX OR DARWIN)
set(HUNSPELL_LIBRARY hunspell-1.2)
else (LINUX OR DARWIN)
set(HUNSPELL_LIBRARY libhunspell)
endif (LINUX OR DARWIN)
endif (STANDALONE)

View File

@@ -1,16 +0,0 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
include(FindHunSpell)
else (STANDALONE)
use_prebuilt_binary(hunspell)
set(HUNSPELL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/hunspell)
if (LINUX OR DARWIN)
set(HUNSPELL_LIBRARY hunspell-1.3)
else (LINUX OR DARWIN)
set(HUNSPELL_LIBRARY libhunspell)
endif (LINUX OR DARWIN)
endif (STANDALONE)

View File

@@ -13,11 +13,11 @@ else (STANDALONE)
set(JPEG_LIBRARIES jpeg) set(JPEG_LIBRARIES jpeg)
elseif (DARWIN) elseif (DARWIN)
set(JPEG_LIBRARIES set(JPEG_LIBRARIES
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libjpeg.a optimized ${ARCH_PREBUILT_DIRS_RELEASE}/liblljpeg.a
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libjpeg.a debug ${ARCH_PREBUILT_DIRS_DEBUG}/liblljpeg.a
) )
elseif (WINDOWS) elseif (WINDOWS)
set(JPEG_LIBRARIES jpeglib) set(JPEG_LIBRARIES jpeglib)
endif (LINUX) endif (LINUX)
set(JPEG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) set(JPEG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -2,7 +2,7 @@
include(Prebuilt) include(Prebuilt)
set(JSONCPP_FIND_QUIETLY OFF) set(JSONCPP_FIND_QUIETLY ON)
set(JSONCPP_FIND_REQUIRED ON) set(JSONCPP_FIND_REQUIRED ON)
if (STANDALONE) if (STANDALONE)
@@ -14,9 +14,9 @@ else (STANDALONE)
debug json_vc${MSVC_SUFFIX}d debug json_vc${MSVC_SUFFIX}d
optimized json_vc${MSVC_SUFFIX}) optimized json_vc${MSVC_SUFFIX})
elseif (DARWIN) elseif (DARWIN)
set(JSONCPP_LIBRARIES json_linux-gcc-4.0.1_libmt) set(JSONCPP_LIBRARIES json_mac-universal-gcc_libmt)
elseif (LINUX) elseif (LINUX)
set(JSONCPP_LIBRARIES jsoncpp) set(JSONCPP_LIBRARIES jsoncpp)
endif (WINDOWS) endif (WINDOWS)
set(JSONCPP_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/jsoncpp) set(JSONCPP_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/jsoncpp)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -1,11 +0,0 @@
# -*- cmake -*-
include(Variables)
set(LLAPPEARANCE_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llappearance
)
set(LLAPPEARANCE_LIBRARIES llappearance)

View File

@@ -14,7 +14,6 @@ endif (DARWIN)
set(LLCOMMON_INCLUDE_DIRS set(LLCOMMON_INCLUDE_DIRS
${LIBS_OPEN_DIR}/cwdebug ${LIBS_OPEN_DIR}/cwdebug
${LIBS_OPEN_DIR}/llcommon ${LIBS_OPEN_DIR}/llcommon
${APRUTIL_INCLUDE_DIR}
${APR_INCLUDE_DIR} ${APR_INCLUDE_DIR}
${Boost_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}
) )

View File

@@ -4,14 +4,12 @@ include(CARes)
include(CURL) include(CURL)
include(OpenSSL) include(OpenSSL)
include(XmlRpcEpi) include(XmlRpcEpi)
include(AIStateMachine)
set(LLMESSAGE_INCLUDE_DIRS set(LLMESSAGE_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llmessage ${LIBS_OPEN_DIR}/llmessage
${CARES_INCLUDE_DIRS} ${CARES_INCLUDE_DIRS}
${CURL_INCLUDE_DIRS} ${CURL_INCLUDE_DIRS}
${OPENSSL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIRS}
${AISTATEMACHINE_INCLUDE_DIRS}
) )
set(LLMESSAGE_LIBRARIES llmessage aistatemachine) set(LLMESSAGE_LIBRARIES llmessage)

View File

@@ -8,7 +8,7 @@ set(LLPLUGIN_INCLUDE_DIRS
if (LINUX) if (LINUX)
# In order to support using ld.gold on linux, we need to explicitely # In order to support using ld.gold on linux, we need to explicitely
# specify all libraries that llplugin uses. # specify all libraries that llplugin uses.
set(LLPLUGIN_LIBRARIES llplugin pthread) set(LLPLUGIN_LIBRARIES llplugin pthread)
else (LINUX) else (LINUX)
set(LLPLUGIN_LIBRARIES llplugin) set(LLPLUGIN_LIBRARIES llplugin)
endif (LINUX) endif (LINUX)

View File

@@ -1,11 +0,0 @@
# -*- cmake -*-
if (STANDALONE)
set(LLQTWEBKIT_INCLUDE_DIR
${LIBS_OPEN_DIR}/llqtwebkit
)
set(LLQTWEBKIT_LIBRARY
llqtwebkit
)
endif (STANDALONE)

View File

@@ -8,5 +8,5 @@ set(LLVFS_INCLUDE_DIRS
set(LLVFS_LIBRARIES set(LLVFS_LIBRARIES
llvfs llvfs
${Boost_REGEX_LIBRARY} ${BOOST_REGEX_LIBRARY}
) )

View File

@@ -13,17 +13,15 @@ if (STANDALONE)
SDL_LIBRARY SDL_LIBRARY
) )
else (STANDALONE) else (STANDALONE)
if (LINUX) if (NOT DARWIN)
use_prebuilt_binary(mesa) use_prebuilt_binary(mesa)
endif (NOT DARWIN)
if (LINUX AND VIEWER)
use_prebuilt_binary(SDL) use_prebuilt_binary(SDL)
set (SDL_FOUND TRUE) set (SDL_FOUND TRUE)
set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}) set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/i686-linux)
if(WORD_SIZE EQUAL 64) set (SDL_LIBRARY SDL)
set (SDL_LIBRARY SDL) endif (LINUX AND VIEWER)
else(WORD_SIZE EQUAL 64)
set (SDL_LIBRARY SDL directfb fusion direct)
endif(WORD_SIZE EQUAL 64)
endif (LINUX)
endif (STANDALONE) endif (STANDALONE)
if (SDL_FOUND) if (SDL_FOUND)

View File

@@ -6,13 +6,17 @@ if (NOT STANDALONE)
set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release) set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release)
set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug) set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug)
elseif (LINUX) elseif (LINUX)
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release) if (VIEWER)
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release_client)
else (VIEWER)
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release)
endif (VIEWER)
set(ARCH_PREBUILT_DIRS_RELEASE ${ARCH_PREBUILT_DIRS}) set(ARCH_PREBUILT_DIRS_RELEASE ${ARCH_PREBUILT_DIRS})
set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS}) set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS})
elseif (DARWIN) elseif (DARWIN)
set(ARCH_PREBUILT_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib) set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib_release)
set(ARCH_PREBUILT_DIRS_RELEASE ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/release) set(ARCH_PREBUILT_DIRS ${ARCH_PREBUILT_DIRS_RELEASE})
set(ARCH_PREBUILT_DIRS_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug) set(ARCH_PREBUILT_DIRS_DEBUG ${ARCH_PREBUILT_DIRS_RELEASE})
endif (WINDOWS) endif (WINDOWS)
endif (NOT STANDALONE) endif (NOT STANDALONE)

View File

@@ -0,0 +1,48 @@
# -*- cmake -*-
set(MONO_PREBUILT_LIBRARIES_DIR ${LIBS_PREBUILT_DIR}/mono/1.0)
set(MONO_PREBUILT_LIBRARIES
Iesi.Collections.dll
Iesi.Collections.pdb
Mono.CompilerServices.SymbolWriter.dll
Mono.PEToolkit.dll
Mono.PEToolkit.pdb
Mono.Security.dll
PEAPI.dll
RAIL.dll
RAIL.pdb
)
set(MONO_CORE_LIBRARIES
System.dll
System.Xml.dll
mscorlib.dll)
if(WINDOWS)
set(MONO_DEPENDENCIES
DomainCreator
DomainRegister
LslLibrary
LslUserScript
Script
ScriptTypes
TestFormat
UserScript
UThread
UThreadInjector
)
else(WINDOWS)
set(MONO_DEPENDENCIES
DomainCreator_POST_BUILD
DomainRegister_POST_BUILD
LslLibrary_POST_BUILD
LslUserScript_POST_BUILD
Script_POST_BUILD
ScriptTypes_POST_BUILD
TestFormat_POST_BUILD
UserScript_POST_BUILD
UThread_POST_BUILD
UThreadInjector_POST_BUILD
)
endif(WINDOWS)

View File

@@ -0,0 +1,57 @@
# -*- cmake -*-
include(Prebuilt)
use_prebuilt_binary(libmono)
SET(GLIB_2_0 glib-2.0)
if (WINDOWS)
SET(MONO_LIB mono)
else (WINDOWS)
SET(MONO_LIB mono)
SET(M_LIBRARIES m)
SET(GTHREAD_2_0 gthread-2.0)
endif(WINDOWS)
IF (DARWIN)
FIND_LIBRARY(MONO_LIBRARY NAMES Mono)
# Find_file doesnt work as expected. Hardcode relative to Mono.framework.
#FIND_FILE(GLIB_CONFIG glibconfig.h ${MONO_LIBRARY})
#FIND_FILE(MONO_GLIB_LIBRARY glib.h ${MONO_LIBRARY})
SET(MONO_GLIB_LIBRARY ${MONO_LIBRARY}/Headers/glib-2.0/)
SET(GLIB_CONFIG ${MONO_LIBRARY}/Libraries/glib-2.0/include/)
SET(MONO_LIB_DIRECTORY ${MONO_LIBRARY}/Libraries)
IF (MONO_LIBRARY AND MONO_GLIB_LIBRARY AND GLIB_CONFIG)
MESSAGE(STATUS "Found Mono for embedding")
INCLUDE_DIRECTORIES(${MONO_GLIB_LIBRARY} ${GLIB_CONFIG})
LINK_DIRECTORIES(${MONO_LIB_DIRECTORY})
ELSE (MONO_LIBRARY AND MONO_GLIB_LIBRARY AND GLIB_CONFIG)
MESSAGE(FATAL_ERROR "Mono not found for embedding")
MESSAGE(${MONO_LIBRARY})
MESSAGE(${MONO_GLIB_LIBRARY})
MESSAGE(${GLIB_CONFIG})
ENDIF (MONO_LIBRARY AND MONO_GLIB_LIBRARY AND GLIB_CONFIG)
ELSE (DARWIN)
SET(MONO_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
SET(GLIB_2_0_PLATFORM_INCLUDE_DIR
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/glib-2.0)
SET(GLIB_2_0_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/glib-2.0)
INCLUDE_DIRECTORIES(
${MONO_INCLUDE_DIR}
${GLIB_2_0_PLATFORM_INCLUDE_DIR}
${GLIB_2_0_INCLUDE_DIR})
ENDIF (DARWIN)
SET(MONO_LIBRARIES
${MONO_LIB}
${M_LIBRARIES}
${GLIB_2_0}
${GTHREAD_2_0}
)

26
indra/cmake/MySQL.cmake Normal file
View File

@@ -0,0 +1,26 @@
# -*- cmake -*-
include(Linking)
include(Prebuilt)
use_prebuilt_binary(mysql)
if (LINUX)
if (WORD_SIZE EQUAL 32 OR DEBIAN_VERSION STREQUAL "3.1")
set(MYSQL_LIBRARIES mysqlclient)
set(MYSQL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
else (WORD_SIZE EQUAL 32 OR DEBIAN_VERSION STREQUAL "3.1")
# Use the native MySQL library on a 64-bit system.
set(MYSQL_FIND_QUIETLY ON)
set(MYSQL_FIND_REQUIRED ON)
include(FindMySQL)
endif (WORD_SIZE EQUAL 32 OR DEBIAN_VERSION STREQUAL "3.1")
elseif (WINDOWS)
set(MYSQL_LIBRARIES mysqlclient)
set(MYSQL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
elseif (DARWIN)
set(MYSQL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
set(MYSQL_LIBRARIES
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libmysqlclient.a
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libmysqlclient.a
)
endif (LINUX)

View File

@@ -15,7 +15,7 @@ else (STANDALONE)
set(NDOF_LIBRARY ndofdev) set(NDOF_LIBRARY ndofdev)
endif (WINDOWS) endif (WINDOWS)
set(NDOF_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/ndofdev) set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev)
set(NDOF_FOUND 1) set(NDOF_FOUND 1)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -21,7 +21,6 @@ if (OPENAL)
openal openal
alut alut
) )
set(OPENAL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
endif (OPENAL) endif (OPENAL)
if (OPENAL) if (OPENAL)

View File

@@ -6,5 +6,5 @@ if (NOT (STANDALONE OR DARWIN))
# possible glh_linear should have its own .cmake file instead # possible glh_linear should have its own .cmake file instead
#use_prebuilt_binary(glh_linear) #use_prebuilt_binary(glh_linear)
# actually... not any longer, it's now in git -SG # actually... not any longer, it's now in git -SG
set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) set(GLEXT_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
endif () endif ()

View File

@@ -4,9 +4,9 @@ include(Prebuilt)
set(OpenSSL_FIND_QUIETLY ON) set(OpenSSL_FIND_QUIETLY ON)
set(OpenSSL_FIND_REQUIRED ON) set(OpenSSL_FIND_REQUIRED ON)
if (STANDALONE OR USE_SYSTEM_OPENSSL) if (STANDALONE)
include(FindOpenSSL) include(FindOpenSSL)
else (STANDALONE OR USE_SYSTEM_OPENSSL) else (STANDALONE)
use_prebuilt_binary(openSSL) use_prebuilt_binary(openSSL)
if (WINDOWS) if (WINDOWS)
set(OPENSSL_LIBRARIES ssleay32 libeay32) set(OPENSSL_LIBRARIES ssleay32 libeay32)
@@ -14,8 +14,10 @@ else (STANDALONE OR USE_SYSTEM_OPENSSL)
set(OPENSSL_LIBRARIES ssl) set(OPENSSL_LIBRARIES ssl)
endif (WINDOWS) endif (WINDOWS)
set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
endif (STANDALONE OR USE_SYSTEM_OPENSSL) endif (STANDALONE)
if (LINUX OR DARWIN) if (LINUX)
set(CRYPTO_LIBRARIES crypto) set(CRYPTO_LIBRARIES crypto)
endif (LINUX OR DARWIN) elseif (DARWIN)
set(CRYPTO_LIBRARIES llcrypto)
endif (LINUX)

View File

@@ -10,10 +10,8 @@ else (STANDALONE)
use_prebuilt_binary(libpng) use_prebuilt_binary(libpng)
if (WINDOWS) if (WINDOWS)
set(PNG_LIBRARIES libpng15) set(PNG_LIBRARIES libpng15)
elseif(DARWIN) else (WINDOWS)
set(PNG_LIBRARIES png15) set(PNG_LIBRARIES png12)
else(LINUX) endif (WINDOWS)
set(PNG_LIBRARIES png15) set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif()
set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/)
endif (STANDALONE) endif (STANDALONE)

2
indra/cmake/PulseAudio.cmake Normal file → Executable file
View File

@@ -13,7 +13,7 @@ if (PULSEAUDIO)
use_prebuilt_binary(pulseaudio) use_prebuilt_binary(pulseaudio)
set(PULSEAUDIO_FOUND ON FORCE BOOL) set(PULSEAUDIO_FOUND ON FORCE BOOL)
set(PULSEAUDIO_INCLUDE_DIRS set(PULSEAUDIO_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include ${LIBS_PREBUILT_DIR}/include
) )
# We don't need to explicitly link against pulseaudio itself, because # We don't need to explicitly link against pulseaudio itself, because
# the viewer probes for the system's copy at runtime. # the viewer probes for the system's copy at runtime.

View File

@@ -19,6 +19,7 @@ if (WINDOWS)
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
) )
elseif (EXISTS /etc/debian_version) elseif (EXISTS /etc/debian_version)
# On Debian and Ubuntu, avoid Python 2.4 if possible. # On Debian and Ubuntu, avoid Python 2.4 if possible.

View File

@@ -1,12 +0,0 @@
# -*- cmake -*-
include(Prebuilt)
if (STANDALONE)
set(Qt4_FIND_REQUIRED ON)
include(FindQt4)
find_package(Qt4 4.7.0 COMPONENTS QtCore QtGui QtNetwork QtOpenGL QtWebKit REQUIRED)
include(${QT_USE_FILE})
add_definitions(${QT_DEFINITIONS})
endif (STANDALONE)

View File

@@ -1,4 +0,0 @@
# -*- cmake -*-
set(STATEMACHINE_INCLUDE_DIRS statemachine)
set(STATEMACHINE_LIBRARIES statemachine)

View File

@@ -31,12 +31,13 @@ if (STANDALONE)
add_definitions(${${pkg}_CFLAGS_OTHERS}) add_definitions(${${pkg}_CFLAGS_OTHERS})
endforeach(pkg) endforeach(pkg)
else (STANDALONE) else (STANDALONE)
if (LINUX) if (NOT DARWIN)
use_prebuilt_binary(glib) # gtk-etc needs glib use_prebuilt_binary(glib) # gtk-etc needs glib
use_prebuilt_binary(gtk-atk-pango-glib) use_prebuilt_binary(gtk-atk-pango-glib)
endif (NOT DARWIN)
if (LINUX)
set(UI_LIBRARIES set(UI_LIBRARIES
atk-1.0 atk-1.0
X11
gdk-x11-2.0 gdk-x11-2.0
gdk_pixbuf-2.0 gdk_pixbuf-2.0
Xinerama Xinerama
@@ -58,6 +59,7 @@ else (STANDALONE)
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/cairo ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/cairo
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/pixman-1 ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/pixman-1
${LIBS_PREBUILT_DIR}/include
) )
foreach(include ${${LL_ARCH}_INCLUDES}) foreach(include ${${LL_ARCH}_INCLUDES})
include_directories(${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/${include}) include_directories(${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/${include})

View File

@@ -30,7 +30,6 @@ set(LIBS_SERVER_DIR ${CMAKE_SOURCE_DIR}/${LIBS_SERVER_PREFIX})
set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/${SCRIPTS_PREFIX}) set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/${SCRIPTS_PREFIX})
set(SERVER_DIR ${CMAKE_SOURCE_DIR}/${SERVER_PREFIX}) set(SERVER_DIR ${CMAKE_SOURCE_DIR}/${SERVER_PREFIX})
set(VIEWER_DIR ${CMAKE_SOURCE_DIR}/${VIEWER_PREFIX}) set(VIEWER_DIR ${CMAKE_SOURCE_DIR}/${VIEWER_PREFIX})
set(DISABLE_TCMALLOC OFF CACHE BOOL "Disable linkage of TCMalloc. (64bit builds automatically disable TCMalloc)")
set(LL_TESTS OFF CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation)") set(LL_TESTS OFF CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation)")
set(VISTA_ICON OFF CACHE BOOL "Allow vista icon with pre 2008 Visual Studio IDEs. (Assumes replacement old rcdll.dll with new rcdll.dll from win sdk 7.0 or later)") set(VISTA_ICON OFF CACHE BOOL "Allow vista icon with pre 2008 Visual Studio IDEs. (Assumes replacement old rcdll.dll with new rcdll.dll from win sdk 7.0 or later)")
@@ -77,36 +76,37 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(DARWIN 1) set(DARWIN 1)
if(${CMAKE_GENERATOR} MATCHES Xcode) #SDK Compiler and Deployment targets for XCode
#SDK Compiler and Deployment targets for XCode if (${XCODE_VERSION} VERSION_LESS 4.0.0)
if (${XCODE_VERSION} VERSION_LESS 4.0.0) set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk) set(CMAKE_XCODE_ATTIBUTE_GCC_VERSION "4.2")
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5) else (${XCODE_VERSION} VERSION_LESS 4.0.0)
set(CMAKE_XCODE_ATTIBUTE_GCC_VERSION "4.2")
else (${XCODE_VERSION} VERSION_LESS 4.0.0)
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
endif (${XCODE_VERSION} VERSION_LESS 4.0.0)
else()
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk) set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42") set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvmgcc42")
endif(${CMAKE_GENERATOR} MATCHES Xcode) endif (${XCODE_VERSION} VERSION_LESS 4.0.0)
## We currently support only 32-bit i386 builds, so use these: set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
set(CMAKE_OSX_ARCHITECTURES i386)
set(ARCH i386)
set(WORD_SIZE 32)
## But if you want to compile for mixed 32/64 bit, try these: # NOTE: To attempt an i386/PPC Universal build, add this on the configure line:
# set(CMAKE_OSX_ARCHITECTURES i386;x86_64) # -DCMAKE_OSX_ARCHITECTURES:STRING='i386;ppc'
# set(ARCH universal) # Build only for i386 by default, system default on MacOSX 10.6 is x86_64
# set(WORD_SIZE 64) if (NOT CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES i386)
endif (NOT CMAKE_OSX_ARCHITECTURES)
if (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
set(ARCH universal)
else (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
set(ARCH ppc)
else (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
set(ARCH i386)
endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
endif (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
## Finally, set up the build output directories
set(LL_ARCH ${ARCH}_darwin) set(LL_ARCH ${ARCH}_darwin)
set(LL_ARCH_DIR universal-darwin) set(LL_ARCH_DIR universal-darwin)
set(WORD_SIZE 32)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

View File

@@ -0,0 +1,9 @@
include(BuildVersion)
if(VIEWER)
build_version(viewer)
endif(VIEWER)
if(SERVER)
build_version(server)
endif(SERVER)

View File

@@ -19,3 +19,8 @@ else (NOT STANDALONE)
endif(LINUX AND ${ARCH} STREQUAL "x86_64") endif(LINUX AND ${ARCH} STREQUAL "x86_64")
set(STANDALONE ON) set(STANDALONE ON)
endif(NOT STANDALONE) endif(NOT STANDALONE)
if (WINDOWS)
use_prebuilt_binary(dbghelp)
endif (WINDOWS)

View File

@@ -1,10 +1,31 @@
# -*- cmake -*- # -*- cmake -*-
include(Linking) include(Linking)
include(Prebuilt) include(Prebuilt)
include(LLQtWebkit)
include(Qt4)
if (STANDALONE) if (STANDALONE)
# The minimal version, 4.4.3, is rather arbitrary: it's the version in Debian/Lenny.
find_package(Qt4 4.4.3 COMPONENTS QtCore QtGui QtNetwork QtOpenGL QtWebKit REQUIRED)
include(${QT_USE_FILE})
set(QTDIR $ENV{QTDIR})
if (QTDIR AND NOT "${QT_BINARY_DIR}" STREQUAL "${QTDIR}/bin")
message(FATAL_ERROR "\"${QT_BINARY_DIR}\" is unequal \"${QTDIR}/bin\"; "
"Qt is found by looking for qmake in your PATH. "
"Please set your PATH such that 'qmake' is found in \$QTDIR/bin, "
"or unset QTDIR if the found Qt is correct.")
endif (QTDIR AND NOT "${QT_BINARY_DIR}" STREQUAL "${QTDIR}/bin")
find_package(LLQtWebkit REQUIRED QUIET)
# Add the plugins.
set(QT_PLUGIN_LIBRARIES)
foreach(qlibname qgif qjpeg)
find_library(QT_PLUGIN_${qlibname} ${qlibname} PATHS ${QT_PLUGINS_DIR}/imageformats NO_DEFAULT_PATH)
if (QT_PLUGIN_${qlibname})
list(APPEND QT_PLUGIN_LIBRARIES ${QT_PLUGIN_${qlibname}})
else (QT_PLUGIN_${qtlibname})
message(FATAL_ERROR "Could not find the Qt plugin ${qlibname} in \"${QT_PLUGINS_DIR}/imageformats\"!")
endif (QT_PLUGIN_${qlibname})
endforeach(qlibname)
# qjpeg depends on libjpeg
list(APPEND QT_PLUGIN_LIBRARIES jpeg)
set(WEBKITLIBPLUGIN OFF CACHE BOOL set(WEBKITLIBPLUGIN OFF CACHE BOOL
"WEBKITLIBPLUGIN support for the llplugin/llmedia test apps.") "WEBKITLIBPLUGIN support for the llplugin/llmedia test apps.")
else (STANDALONE) else (STANDALONE)
@@ -46,16 +67,11 @@ elseif (LINUX)
QtNetwork QtNetwork
QtGui QtGui
QtCore QtCore
crypto
ssl
# qgif
# qjpeg
jscore jscore
jpeg jpeg
fontconfig fontconfig
X11 X11
Xrender Xrender
Xext
GL GL
) )
endif (STANDALONE) endif (STANDALONE)

View File

@@ -9,5 +9,5 @@ if (STANDALONE)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(xmlrpc-epi) use_prebuilt_binary(xmlrpc-epi)
set(XMLRPCEPI_LIBRARIES xmlrpc-epi) set(XMLRPCEPI_LIBRARIES xmlrpc-epi)
set(XMLRPCEPI_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include) set(XMLRPCEPI_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -17,6 +17,6 @@ else (STANDALONE)
set(ZLIB_LIBRARIES z) set(ZLIB_LIBRARIES z)
endif (WINDOWS) endif (WINDOWS)
if (WINDOWS OR LINUX) if (WINDOWS OR LINUX)
set(ZLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/zlib) set(ZLIB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/zlib)
endif (WINDOWS OR LINUX) endif (WINDOWS OR LINUX)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -0,0 +1,39 @@
# -*- cmake -*-
project(cwdebug)
include(00-Common)
include(LLCommon)
include(LLMath)
include(LLMessage)
include(LLVFS)
include_directories (${CMAKE_CURRENT_SOURCE_DIR})
set(cwdebug_SOURCE_FILES
debug.cc
)
set(cwdebug_HEADER_FILES
CMakeLists.txt
cwdebug.h
sys.h
debug.h
debug_ostream_operators.h
)
set_source_files_properties(${cwdebug_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE)
if(NOT WORD_SIZE EQUAL 32)
if(WINDOWS)
add_definitions(/FIXED:NO)
else(WINDOWS) # not windows therefore gcc LINUX and DARWIN
add_definitions(-fPIC)
endif(WINDOWS)
endif (NOT WORD_SIZE EQUAL 32)
list(APPEND cwdebug_SOURCE_FILES ${cwdebug_HEADER_FILES})
add_library (cwdebug ${cwdebug_SOURCE_FILES})

View File

@@ -49,8 +49,6 @@
namespace debug { namespace debug {
#if CWDEBUG_LOCATION #if CWDEBUG_LOCATION
ll_thread_local size_t BackTrace::S_number;
void BackTrace::dump_backtrace(void) const void BackTrace::dump_backtrace(void) const
{ {
for (int frame = 0; frame < frames(); ++frame) for (int frame = 0; frame < frames(); ++frame)
@@ -69,67 +67,6 @@ void BackTrace::dump_backtrace(void) const
Dout(dc::finish, mangled_function_name); Dout(dc::finish, mangled_function_name);
} }
} }
void BackTraces::store_trace(size_t trace)
{
mBackTraces.push_back(trace);
}
void BackTraces::remove_trace(size_t trace)
{
trace_container_type::iterator iter = mBackTraces.begin();
while (iter != mBackTraces.end())
{
if (*iter == trace)
{
*iter = mBackTraces.back();
mBackTraces.pop_back();
return;
}
++iter;
}
DoutFatal(dc::core, "Trace doesn't exist!");
}
void BackTraces::dump(void) const
{
Dout(dc::backtrace|continued_cf, "Dump for (BackTraces*)" << (void*)this << " (" << mBackTraces.size() << " backtraces): ");
for (trace_container_type::const_iterator iter = mBackTraces.begin(); iter != mBackTraces.end(); ++iter)
{
Dout(dc::continued|nonewline_cf, *iter << ' ');
}
Dout(dc::finish, "");
}
BackTraceTracker::BackTraceTracker(BackTraces* back_traces) : mBackTraces(back_traces)
{
BACKTRACE;
mTrace = BackTrace::S_number;
mBackTraces->store_trace(mTrace);
}
BackTraceTracker::~BackTraceTracker()
{
mBackTraces->remove_trace(mTrace);
}
BackTraceTracker::BackTraceTracker(BackTraceTracker const& orig) : mBackTraces(orig.mBackTraces)
{
BACKTRACE;
mTrace = BackTrace::S_number;
mBackTraces->store_trace(mTrace);
}
BackTraceTracker& BackTraceTracker::operator=(BackTraceTracker const& orig)
{
mBackTraces->remove_trace(mTrace);
mBackTraces = orig.mBackTraces;
BACKTRACE;
mTrace = BackTrace::S_number;
mBackTraces->store_trace(mTrace);
return *this;
}
#endif // CWDEBUG_LOCATION #endif // CWDEBUG_LOCATION
#if CWDEBUG_ALLOC && CWDEBUG_LOCATION #if CWDEBUG_ALLOC && CWDEBUG_LOCATION
@@ -234,12 +171,7 @@ void stop_recording_backtraces(void)
channel_ct gtk DDCN("GTK"); //!< This debug channel is used for output related to gtk. channel_ct gtk DDCN("GTK"); //!< This debug channel is used for output related to gtk.
channel_ct sdl DDCN("SDL"); //!< This debug channel is used for output related to sdl locking. channel_ct sdl DDCN("SDL"); //!< This debug channel is used for output related to sdl locking.
channel_ct backtrace DDCN("BACKTRACE"); //!< This debug channel is used for backtraces. channel_ct backtrace DDCN("BACKTRACE"); //!< This debug channel is used for backtraces.
channel_ct statemachine DDCN("STATEMACHINE"); //!< This debug channel is used for output related to class AIStateMachine. channel_ct statemachine DDCN("STATEMACHINE"); //!< This debug channel is used class AIStateMachine.
channel_ct caps DDCN("CAPS"); //!< This debug channel is used for output related to Capabilities.
channel_ct curl DDCN("CURL"); //!< This debug channel is used for output related to AICurl.
channel_ct curlio DDCN("CURLIO"); //!< This debug channel is used to print debug output of libcurl. This includes all HTTP network traffic.
channel_ct curltr DDCN("CURLTR"); //!< This debug channel is used to print libcurl API calls.
channel_ct snapshot DDCN("SNAPSHOT"); //!< This debug channel is used for output related to snapshots.
} // namespace dc } // namespace dc
} // namespace DEBUGCHANNELS } // namespace DEBUGCHANNELS
@@ -478,94 +410,4 @@ void cwdebug_backtrace(int n)
} }
#endif #endif
#elif defined(DEBUG_CURLIO) #endif // CWDEBUG
#include "debug.h"
#include "aithreadid.h"
namespace debug
{
namespace libcwd { libcwd_do_type const libcw_do; }
ll_thread_local int Indent::S_indentation;
Indent::Indent(int indent) : M_indent(indent)
{
S_indentation += M_indent;
}
Indent::~Indent()
{
S_indentation -= M_indent;
}
std::ostream& operator<<(std::ostream& os, Indent::print_nt)
{
if (Indent::S_indentation)
os << std::string(Indent::S_indentation, ' ');
return os;
}
#ifdef DEBUG_CURLIO
std::ostream& operator<<(std::ostream& os, print_thread_id_t)
{
if (!AIThreadID::in_main_thread_inline())
{
os << std::hex << (size_t)AIThreadID::getCurrentThread_inline() << std::dec << ' ';
}
return os;
}
#endif
std::ostream& operator<<(std::ostream& os, libcwd::buf2str const& b2s)
{
static char const c2s_tab[7] = { 'a', 'b', 't', 'n', 'v', 'f', 'r' };
size_t size = b2s.mSize;
for (char const* p1 = b2s.mBuf; size > 0; --size, ++p1)
{
char c =*p1;
if ((c > 31 && c != 92 && c != 127) || (unsigned char)c > 159)
os.put(c);
else
{
os.put('\\');
if (c > 6 && c < 14)
{
os.put(c2s_tab[c - 7]);
return os;
}
else if (c == 27)
{
os.put('e');
return os;
}
else if (c == '\\')
{
os.put('\\');
return os;
}
std::ostream::char_type old_fill = os.fill('0');
std::ios_base::fmtflags old_flgs = os.flags();
os.width(3);
os << std::oct << (int)((unsigned char)c);
os.setf(old_flgs);
os.fill(old_fill);
}
}
return os;
}
namespace dc
{
fake_channel const warning(1, "WARNING ");
fake_channel const curl(1, "CURL ");
fake_channel const curlio(1, "CURLIO ");
fake_channel const statemachine(1, "STATEMACHINE");
fake_channel const notice(1, "NOTICE ");
} // namespace dc
} // namespace debug
#endif

View File

@@ -27,94 +27,6 @@
#ifndef CWDEBUG #ifndef CWDEBUG
#ifdef DEBUG_CURLIO
// If CWDEBUG is not defined, but DEBUG_CURLIO is, then replace
// some of the cwd macro's with something that generates viewer
// specific debug output. Note that this generates a LOT of
// output and should not normally be defined.
#include <string>
#include "llpreprocessor.h"
namespace debug {
namespace libcwd {
struct buf2str {
buf2str(char const* buf, int size) : mBuf(buf), mSize(size) { }
char const* mBuf;
int mSize;
};
struct libcwd_do_type {
void on() const { }
};
extern LL_COMMON_API libcwd_do_type const libcw_do;
} // namespace libcwd
enum print_thread_id_t { print_thread_id };
inline void init() { }
struct Indent {
int M_indent;
static ll_thread_local int S_indentation;
enum LL_COMMON_API print_nt { print };
LL_COMMON_API Indent(int indent);
LL_COMMON_API ~Indent();
};
extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, libcwd::buf2str const& b2s);
extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, Indent::print_nt);
extern LL_COMMON_API std::ostream& operator<<(std::ostream& os, print_thread_id_t);
namespace dc {
struct fake_channel {
int mOn;
char const* mLabel;
fake_channel(int on, char const* label) : mOn(on), mLabel(label) { }
fake_channel(void) : mOn(0) { }
bool is_on() const { return !!mOn; }
bool is_off() const { return !mOn; }
void on() const { }
void off() const { }
};
extern LL_COMMON_API fake_channel const warning;
extern LL_COMMON_API fake_channel const curl;
extern LL_COMMON_API fake_channel const curlio;
extern LL_COMMON_API fake_channel const statemachine;
extern LL_COMMON_API fake_channel const notice;
} // namespace dc
} // namespace debug
#define LIBCWD_DEBUG_CHANNELS debug
#define LibcwDoutScopeBegin(a, b, c) do { using namespace debug; using namespace debug::libcwd; llinfos_nf << print_thread_id << (c).mLabel << ": " << Indent::print;
#define LibcwDoutStream llcont
#define LibcwDoutScopeEnd llcont << llendl; } while(0)
#define Debug(x) do { using namespace debug; using namespace debug::libcwd; x; } while(0)
#define Dout(a, b) do { using namespace debug; using namespace debug::libcwd; if ((a).mOn) { llinfos_nf << print_thread_id << (a).mLabel << ": " << Indent::print << b << llendl; } } while(0)
#define DoutEntering(a, b) \
int __slviewer_debug_indentation = 2; \
{ \
using namespace debug; \
using namespace debug::libcwd; \
if ((a).mOn) \
llinfos_nf << print_thread_id << (a).mLabel << ": " << Indent::print << "Entering " << b << llendl; \
else \
__slviewer_debug_indentation = 0; \
} \
debug::Indent __slviewer_debug_indent(__slviewer_debug_indentation);
#else // !DEBUG_CURLIO
#define Debug(x)
#define Dout(a, b)
#define DoutEntering(a, b)
#endif // !DEBUG_CURLIO
#ifndef DOXYGEN // No need to document this. See http://libcwd.sourceforge.net/ for more info. #ifndef DOXYGEN // No need to document this. See http://libcwd.sourceforge.net/ for more info.
#include <iostream> #include <iostream>
@@ -124,6 +36,9 @@ extern LL_COMMON_API fake_channel const notice;
#define AllocTag2(p, desc) #define AllocTag2(p, desc)
#define AllocTag_dynamic_description(p, x) #define AllocTag_dynamic_description(p, x)
#define AllocTag(p, x) #define AllocTag(p, x)
#define Debug(x)
#define Dout(a, b)
#define DoutEntering(a, b)
#define DoutFatal(a, b) LibcwDoutFatal(::std, , a, b) #define DoutFatal(a, b) LibcwDoutFatal(::std, , a, b)
#define ForAllDebugChannels(STATEMENT) #define ForAllDebugChannels(STATEMENT)
#define ForAllDebugObjects(STATEMENT) #define ForAllDebugObjects(STATEMENT)
@@ -173,9 +88,7 @@ extern LL_COMMON_API fake_channel const notice;
#include <boost/shared_array.hpp> #include <boost/shared_array.hpp>
#if CWDEBUG_LOCATION #if CWDEBUG_LOCATION
#include <execinfo.h> // Needed for 'backtrace'. #include <execinfo.h> // Needed for 'backtrace'.
#include "llpreprocessor.h"
#endif #endif
#include <set>
#define CWD_API __attribute__ ((visibility("default"))) #define CWD_API __attribute__ ((visibility("default")))
@@ -204,11 +117,6 @@ extern CWD_API channel_ct gtk;
extern CWD_API channel_ct sdl; extern CWD_API channel_ct sdl;
extern CWD_API channel_ct backtrace; extern CWD_API channel_ct backtrace;
extern CWD_API channel_ct statemachine; extern CWD_API channel_ct statemachine;
extern CWD_API channel_ct caps;
extern CWD_API channel_ct curl;
extern CWD_API channel_ct curlio;
extern CWD_API channel_ct curltr;
extern CWD_API channel_ct snapshot;
#endif #endif
@@ -277,8 +185,6 @@ class BackTrace {
private: private:
boost::shared_array<void*> M_buffer; boost::shared_array<void*> M_buffer;
int M_frames; int M_frames;
public:
static ll_thread_local size_t S_number;
public: public:
BackTrace(void** buffer, int frames) : M_buffer(new void* [frames]), M_frames(frames) { std::memcpy(M_buffer.get(), buffer, sizeof(void*) * frames); } BackTrace(void** buffer, int frames) : M_buffer(new void* [frames]), M_frames(frames) { std::memcpy(M_buffer.get(), buffer, sizeof(void*) * frames); }
@@ -305,81 +211,19 @@ extern pthread_mutex_t backtrace_mutex;
using namespace debug; \ using namespace debug; \
void* buffer[32]; \ void* buffer[32]; \
int frames = backtrace(buffer, 32); \ int frames = backtrace(buffer, 32); \
size_t size; \
{ \ { \
pthread_mutex_lock(&backtrace_mutex); \ pthread_mutex_lock(&backtrace_mutex); \
backtraces.push_back(BackTrace(buffer, frames)); \ backtraces.push_back(BackTrace(buffer, frames)); \
BackTrace::S_number = backtraces.size(); \ size = backtraces.size(); \
pthread_mutex_unlock(&backtrace_mutex); \ pthread_mutex_unlock(&backtrace_mutex); \
} \ } \
Dout(dc::backtrace, "Stored backtrace #" << BackTrace::S_number); \ Dout(dc::backtrace, "Stored backtrace #" << size); \
} while(0) } while(0)
class LL_COMMON_API BackTraces {
private:
typedef std::vector<size_t> trace_container_type;
trace_container_type mBackTraces;
public:
void store_trace(size_t trace);
void remove_trace(size_t trace);
void dump(void) const;
};
class LL_COMMON_API BackTraceTracker {
private:
BackTraces* mBackTraces;
size_t mTrace;
public:
BackTraceTracker(BackTraces* back_traces);
~BackTraceTracker();
BackTraceTracker(BackTraceTracker const&);
BackTraceTracker& operator=(BackTraceTracker const&);
void dump(void) const { mBackTraces->dump(); }
};
#else #else
#define BACKTRACE do { } while(0) #define BACKTRACE do { } while(0)
#endif // CWDEBUG_LOCATION #endif // CWDEBUG_LOCATION
template<class T>
class LL_COMMON_API InstanceTracker {
private:
T const* mInstance;
static pthread_mutex_t sInstancesMutex;
static std::set<T const*> sInstances;
static void remember(T const* instance) { pthread_mutex_lock(&sInstancesMutex); sInstances.insert(instance); pthread_mutex_unlock(&sInstancesMutex); }
static void forget(T const* instance) { pthread_mutex_lock(&sInstancesMutex); sInstances.erase(instance); pthread_mutex_unlock(&sInstancesMutex); }
public:
InstanceTracker(T const* instance) : mInstance(instance) { remember(mInstance); }
~InstanceTracker() { forget(mInstance); }
InstanceTracker& operator=(InstanceTracker const& orig) { forget(mInstance); mInstance = orig.mInstance; remember(mInstance); return *this; }
static void dump(void);
private:
// Non-copyable. Instead of copying, call InstanceTracker(T const*) with the this pointer of the new instance.
InstanceTracker(InstanceTracker const& orig);
};
template<class T>
pthread_mutex_t InstanceTracker<T>::sInstancesMutex = PTHREAD_MUTEX_INITIALIZER;
template<class T>
std::set<T const*> InstanceTracker<T>::sInstances;
template<class T>
void InstanceTracker<T>::dump(void)
{
pthread_mutex_lock(&sInstancesMutex);
for (typename std::set<T const*>::iterator iter = sInstances.begin(); iter != sInstances.end(); ++iter)
{
std::cout << *iter << std::endl;
}
pthread_mutex_unlock(&sInstancesMutex);
}
} // namespace debug } // namespace debug
//! Debugging macro. //! Debugging macro.

View File

@@ -70,7 +70,7 @@ def quote(opts):
class PlatformSetup(object): class PlatformSetup(object):
generator = None generator = None
build_types = {} build_types = {}
for t in ('Debug', 'Release', 'RelWithDebInfo'): for t in ('Debug', 'Release', 'ReleaseSSE2', 'RelWithDebInfo'):
build_types[t.lower()] = t build_types[t.lower()] = t
build_type = build_types['relwithdebinfo'] build_type = build_types['relwithdebinfo']
@@ -764,7 +764,7 @@ Options:
--unattended build unattended, do not invoke any tools requiring --unattended build unattended, do not invoke any tools requiring
a human response a human response
--universal build a universal binary on Mac OS X (unsupported) --universal build a universal binary on Mac OS X (unsupported)
-t | --type=NAME build type ("Debug", "Release", or "RelWithDebInfo") -t | --type=NAME build type ("Debug", "Release", "ReleaseSSE2", or "RelWithDebInfo")
-m32 | -m64 build architecture (32-bit or 64-bit) -m32 | -m64 build architecture (32-bit or 64-bit)
-N | --no-distcc disable use of distcc -N | --no-distcc disable use of distcc
-G | --generator=NAME generator name -G | --generator=NAME generator name
@@ -775,21 +775,21 @@ Options:
-p | --project=NAME set the root project name. (Doesn't effect makefiles) -p | --project=NAME set the root project name. (Doesn't effect makefiles)
Commands: Commands:
build configure and build default target build configure and build default target
clean delete all build directories, does not affect sources clean delete all build directories, does not affect sources
configure configure project by running cmake (default command if none given)
configure configure project by running cmake (default if none given) configure configure project by running cmake (default if none given)
printbuilddirs print the build directory that will be used printbuilddirs print the build directory that will be used
Command-options for "configure": Command-options for "configure":
We use cmake variables to change the build configuration. We use cmake variables to change the build configuration.
-DSERVER:BOOL=OFF Don't configure simulator/dataserver/etc -DSERVER:BOOL=OFF Don't configure simulator/dataserver/etc
-DVIEWER:BOOL=OFF Don't configure the viewer -DVIEWER:BOOL=OFF Don't configure the viewer
-DPACKAGE:BOOL=ON Create "package" target to make installers -DPACKAGE:BOOL=ON Create "package" target to make installers
-DLOCALIZESETUP:BOOL=ON Create one win_setup target per supported language -DLOCALIZESETUP:BOOL=ON Create one win_setup target per supported language
-DLL_TESTS:BOOL=OFF Don't generate unit test projects -DLL_TESTS:BOOL=OFF Don't generate unit test projects
-DEXAMPLEPLUGIN:BOOL=OFF Don't generate example plugin project -DEXAMPLEPLUGIN:BOOL=OFF Don't generate example plugin project
-DDISABLE_TCMALLOC:BOOL=ON Disable linkage of TCMalloc. (64bit builds automatically disable TCMalloc) -VISTA_ICON:BOOL=ON Allow pre-2008 VS to use vista-optimized resource file. (Requires updated rcdll.dll!)
-DVISTA_ICON:BOOL=ON Allow pre-2008 VS to use vista-optimized resource file. (Requires updated rcdll.dll!)
Examples: Examples:
Set up a viewer-only project for your system: Set up a viewer-only project for your system:

View File

@@ -120,7 +120,7 @@ ARGUMENTS=[
On Linux this would try to use Linux_i686Manifest.""", On Linux this would try to use Linux_i686Manifest.""",
default=""), default=""),
dict(name='build', description='Build directory.', default=DEFAULT_SRCTREE), dict(name='build', description='Build directory.', default=DEFAULT_SRCTREE),
dict(name='buildtype', description="""The build type used. ('Debug', 'Release', or 'RelWithDebInfo') dict(name='buildtype', description="""The build type used. ('Debug', 'Release', 'ReleaseSSE2' or 'RelWithDebInfo')
Default is Release """, Default is Release """,
default="Release"), default="Release"),
dict(name='branding_id', description="""Identifier for the branding set to dict(name='branding_id', description="""Identifier for the branding set to
@@ -168,10 +168,7 @@ ARGUMENTS=[
dict(name='version', dict(name='version',
description="""This specifies the version of Second Life that is description="""This specifies the version of Second Life that is
being packaged up.""", being packaged up.""",
default=get_default_version), default=get_default_version)
dict(name='extra_libraries',
description="""List of extra libraries to include in package""",
default=None)
] ]
def usage(srctree=""): def usage(srctree=""):

View File

@@ -7,15 +7,14 @@ include(00-Common)
# OPENJPEG version number, useful for packaging and doxygen doc: # OPENJPEG version number, useful for packaging and doxygen doc:
set(OPENJPEG_VERSION_MAJOR 1) set(OPENJPEG_VERSION_MAJOR 1)
set(OPENJPEG_VERSION_MINOR 5) set(OPENJPEG_VERSION_MINOR 4)
set(OPENJPEG_VERSION_BUILD 2) set(OPENJPEG_VERSION_BUILD 0)
set(OPENJPEG_VERSION set(OPENJPEG_VERSION
"${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}") "${OPENJPEG_VERSION_MAJOR}.${OPENJPEG_VERSION_MINOR}.${OPENJPEG_VERSION_BUILD}")
set(openjpeg_SOURCE_FILES set(openjpeg_SOURCE_FILES
bio.c bio.c
cio.c cio.c
cidx_manager.c
dwt.c dwt.c
event.c event.c
image.c image.c
@@ -27,26 +26,20 @@ set(openjpeg_SOURCE_FILES
mqc.c mqc.c
openjpeg.c openjpeg.c
pi.c pi.c
phix_manager.c
ppix_manager.c
raw.c raw.c
t1.c t1.c
t2.c t2.c
tcd.c tcd.c
tgt.c tgt.c
thix_manager.c
tpix_manager.c
) )
set(openjpeg_HEADER_FILES set(openjpeg_HEADER_FILES
bio.h bio.h
cio.h cio.h
cidx_manager.h
dwt.h dwt.h
event.h event.h
fix.h fix.h
image.h image.h
indexbox_manager.h
int.h int.h
j2k.h j2k.h
j2k_lib.h j2k_lib.h
@@ -55,7 +48,6 @@ set(openjpeg_HEADER_FILES
mct.h mct.h
mqc.h mqc.h
openjpeg.h openjpeg.h
opj_config.h
opj_includes.h opj_includes.h
opj_malloc.h opj_malloc.h
pi.h pi.h

View File

@@ -1,211 +0,0 @@
/*
* $Id: cidx_manager.c 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2003-2004, Yannick Verschueren
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "opj_includes.h"
/*
* Write CPTR Codestream finder box
*
* @param[in] coff offset of j2k codestream
* @param[in] clen length of j2k codestream
* @param[in] cio file output handle
*/
void write_cptr(int coff, int clen, opj_cio_t *cio);
/*
* Write main header index table (box)
*
* @param[in] coff offset of j2k codestream
* @param[in] cstr_info codestream information
* @param[in] cio file output handle
* @return length of mainmhix box
*/
int write_mainmhix( int coff, opj_codestream_info_t cstr_info, opj_cio_t *cio);
/*
* Check if EPH option is used
*
* @param[in] coff offset of j2k codestream
* @param[in] markers marker information
* @param[in] marknum number of markers
* @param[in] cio file output handle
* @return true if EPH is used
*/
opj_bool check_EPHuse( int coff, opj_marker_info_t *markers, int marknum, opj_cio_t *cio);
int write_cidx( int offset, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t cstr_info, int j2klen)
{
int len, i, lenp;
opj_jp2_box_t *box;
int num_box = 0;
opj_bool EPHused;
(void)image; /* unused ? */
lenp = -1;
box = (opj_jp2_box_t *)opj_calloc( 32, sizeof(opj_jp2_box_t));
for (i=0;i<2;i++){
if(i)
cio_seek( cio, lenp);
lenp = cio_tell( cio);
cio_skip( cio, 4); /* L [at the end] */
cio_write( cio, JPIP_CIDX, 4); /* CIDX */
write_cptr( offset, cstr_info.codestream_size, cio);
write_manf( i, num_box, box, cio);
num_box = 0;
box[num_box].length = write_mainmhix( offset, cstr_info, cio);
box[num_box].type = JPIP_MHIX;
num_box++;
box[num_box].length = write_tpix( offset, cstr_info, j2klen, cio);
box[num_box].type = JPIP_TPIX;
num_box++;
box[num_box].length = write_thix( offset, cstr_info, cio);
box[num_box].type = JPIP_THIX;
num_box++;
EPHused = check_EPHuse( offset, cstr_info.marker, cstr_info.marknum, cio);
box[num_box].length = write_ppix( offset, cstr_info, EPHused, j2klen, cio);
box[num_box].type = JPIP_PPIX;
num_box++;
box[num_box].length = write_phix( offset, cstr_info, EPHused, j2klen, cio);
box[num_box].type = JPIP_PHIX;
num_box++;
len = cio_tell( cio)-lenp;
cio_seek( cio, lenp);
cio_write( cio, len, 4); /* L */
cio_seek( cio, lenp+len);
}
opj_free( box);
return len;
}
void write_cptr(int coff, int clen, opj_cio_t *cio)
{
int len, lenp;
lenp = cio_tell( cio);
cio_skip( cio, 4); /* L [at the end] */
cio_write( cio, JPIP_CPTR, 4); /* T */
cio_write( cio, 0, 2); /* DR A PRECISER !! */
cio_write( cio, 0, 2); /* CONT */
cio_write( cio, coff, 8); /* COFF A PRECISER !! */
cio_write( cio, clen, 8); /* CLEN */
len = cio_tell( cio) - lenp;
cio_seek( cio, lenp);
cio_write( cio, len, 4); /* L */
cio_seek( cio, lenp+len);
}
void write_manf(int second, int v, opj_jp2_box_t *box, opj_cio_t *cio)
{
int len, lenp, i;
lenp = cio_tell( cio);
cio_skip( cio, 4); /* L [at the end] */
cio_write( cio, JPIP_MANF,4); /* T */
if (second){ /* Write only during the second pass */
for( i=0; i<v; i++){
cio_write( cio, box[i].length, 4); /* Box length */
cio_write( cio, box[i].type, 4); /* Box type */
}
}
len = cio_tell( cio) - lenp;
cio_seek( cio, lenp);
cio_write( cio, len, 4); /* L */
cio_seek( cio, lenp+len);
}
int write_mainmhix( int coff, opj_codestream_info_t cstr_info, opj_cio_t *cio)
{
int i;
int len, lenp;
lenp = cio_tell( cio);
cio_skip( cio, 4); /* L [at the end] */
cio_write( cio, JPIP_MHIX, 4); /* MHIX */
cio_write( cio, cstr_info.main_head_end-cstr_info.main_head_start+1, 8); /* TLEN */
for(i = 1; i < cstr_info.marknum; i++){ /* Marker restricted to 1 apparition, skip SOC marker */
cio_write( cio, cstr_info.marker[i].type, 2);
cio_write( cio, 0, 2);
cio_write( cio, cstr_info.marker[i].pos-coff, 8);
cio_write( cio, cstr_info.marker[i].len, 2);
}
len = cio_tell( cio) - lenp;
cio_seek( cio, lenp);
cio_write( cio, len, 4); /* L */
cio_seek( cio, lenp+len);
return len;
}
opj_bool check_EPHuse( int coff, opj_marker_info_t *markers, int marknum, opj_cio_t *cio)
{
opj_bool EPHused = OPJ_FALSE;
int i=0;
int org_pos;
unsigned int Scod;
for(i = 0; i < marknum; i++){
if( markers[i].type == J2K_MS_COD){
org_pos = cio_tell( cio);
cio_seek( cio, coff+markers[i].pos+2);
Scod = cio_read( cio, 1);
if( ((Scod >> 2) & 1))
EPHused = OPJ_TRUE;
cio_seek( cio, org_pos);
break;
}
}
return EPHused;
}

View File

@@ -1,56 +0,0 @@
/*
* $Id: cidx_manager.h 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2003-2004, Yannick Verschueren
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*! \file
* \brief Modification of jpip.h from 2KAN indexer
*/
#ifndef CIDX_MANAGER_H_
# define CIDX_MANAGER_H_
#include "openjpeg.h"
/*
* Write Codestream index box (superbox)
*
* @param[in] offset offset of j2k codestream
* @param[in] cio file output handle
* @param[in] image image data
* @param[in] cstr_info codestream information
* @param[in] j2klen length of j2k codestream
* @return length of cidx box
*/
int write_cidx( int offset, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t cstr_info, int j2klen);
#endif /* !CIDX_MANAGER_H_ */

View File

@@ -126,13 +126,13 @@ unsigned char *cio_getbp(opj_cio_t *cio) {
/* /*
* Write a byte. * Write a byte.
*/ */
opj_bool cio_byteout(opj_cio_t *cio, unsigned char v) { bool cio_byteout(opj_cio_t *cio, unsigned char v) {
if (cio->bp >= cio->end) { if (cio->bp >= cio->end) {
opj_event_msg(cio->cinfo, EVT_ERROR, "write error\n"); opj_event_msg(cio->cinfo, EVT_ERROR, "write error\n");
return OPJ_FALSE; return false;
} }
*cio->bp++ = v; *cio->bp++ = v;
return OPJ_TRUE; return true;
} }
/* /*
@@ -152,7 +152,7 @@ unsigned char cio_bytein(opj_cio_t *cio) {
* v : value to write * v : value to write
* n : number of bytes to write * n : number of bytes to write
*/ */
unsigned int cio_write(opj_cio_t *cio, unsigned int64 v, int n) { unsigned int cio_write(opj_cio_t *cio, unsigned int v, int n) {
int i; int i;
for (i = n - 1; i >= 0; i--) { for (i = n - 1; i >= 0; i--) {
if( !cio_byteout(cio, (unsigned char) ((v >> (i << 3)) & 0xff)) ) if( !cio_byteout(cio, (unsigned char) ((v >> (i << 3)) & 0xff)) )

View File

@@ -31,13 +31,6 @@
#ifndef __CIO_H #ifndef __CIO_H
#define __CIO_H #define __CIO_H
#if defined(_MSC_VER) || defined(__BORLANDC__)
#define int64 __int64
#else
#define int64 long long
#endif
/** /**
@file cio.h @file cio.h
@brief Implementation of a byte input-output process (CIO) @brief Implementation of a byte input-output process (CIO)
@@ -70,7 +63,7 @@ Write some bytes
@param n Number of bytes to write @param n Number of bytes to write
@return Returns the number of bytes written or 0 if an error occured @return Returns the number of bytes written or 0 if an error occured
*/ */
unsigned int cio_write(opj_cio_t *cio, unsigned int64 v, int n); unsigned int cio_write(opj_cio_t *cio, unsigned int v, int n);
/** /**
Read some bytes Read some bytes
@param cio CIO handle @param cio CIO handle

View File

@@ -64,12 +64,12 @@ typedef struct v4dwt_local {
int cas ; int cas ;
} v4dwt_t ; } v4dwt_t ;
static const float dwt_alpha = 1.586134342f; /* 12994 */ static const float dwt_alpha = 1.586134342f; // 12994
static const float dwt_beta = 0.052980118f; /* 434 */ static const float dwt_beta = 0.052980118f; // 434
static const float dwt_gamma = -0.882911075f; /* -7233 */ static const float dwt_gamma = -0.882911075f; // -7233
static const float dwt_delta = -0.443506852f; /* -3633 */ static const float dwt_delta = -0.443506852f; // -3633
static const float K = 1.230174105f; /* 10078 */ static const float K = 1.230174105f; // 10078
/* FIXME: What is this constant? */ /* FIXME: What is this constant? */
static const float c13318 = 1.625732422f; static const float c13318 = 1.625732422f;
@@ -527,7 +527,7 @@ static void dwt_decode_tile(opj_tcd_tilecomp_t* tilec, int numres, DWT1DFN dwt_1
int w = tilec->x1 - tilec->x0; int w = tilec->x1 - tilec->x0;
h.mem = (int*)opj_aligned_malloc(dwt_decode_max_resolution(tr, numres) * sizeof(int)); h.mem = (int *)opj_aligned_malloc(dwt_decode_max_resolution(tr, numres) * sizeof(int));
v.mem = h.mem; v.mem = h.mem;
while( --numres) { while( --numres) {
@@ -570,7 +570,7 @@ static void v4dwt_interleave_h(v4dwt_t* restrict w, float* restrict a, int x, in
int count = w->sn; int count = w->sn;
int i, k; int i, k;
for(k = 0; k < 2; ++k){ for(k = 0; k < 2; ++k){
if (count + 3 * x < size && ((size_t) a & 0x0f) == 0 && ((size_t) bi & 0x0f) == 0 && (x & 0x0f) == 0) { if (count + 3 * x < size && ((int) a & 0x0f) == 0 && ((int) bi & 0x0f) == 0 && (x & 0x0f) == 0) {
/* Fast code path */ /* Fast code path */
for(i = 0; i < count; ++i){ for(i = 0; i < count; ++i){
int j = i; int j = i;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, Herve Drolon, FreeImage Team * Copyright (c) 2005, Hervé Drolon, FreeImage Team
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -26,42 +26,6 @@
#include "opj_includes.h" #include "opj_includes.h"
/* ==========================================================
Utility functions
==========================================================*/
#ifdef OPJ_CODE_NOT_USED
#ifndef _WIN32
static char*
i2a(unsigned i, char *a, unsigned r) {
if (i/r > 0) a = i2a(i/r,a,r);
*a = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[i%r];
return a+1;
}
/**
Transforms integer i into an ascii string and stores the result in a;
string is encoded in the base indicated by r.
@param i Number to be converted
@param a String result
@param r Base of value; must be in the range 2 - 36
@return Returns a
*/
static char *
_itoa(int i, char *a, int r) {
r = ((r < 2) || (r > 36)) ? 10 : r;
if(i < 0) {
*a = '-';
*i2a(-i, a+1, r) = 0;
}
else *i2a(i, a, r) = 0;
return a;
}
#endif /* !_WIN32 */
#endif
/* ----------------------------------------------------------------------- */
opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo, opj_event_mgr_t *event_mgr, void *context) { opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo, opj_event_mgr_t *event_mgr, void *context) {
if(cinfo) { if(cinfo) {
opj_event_mgr_t *previous = cinfo->event_mgr; opj_event_mgr_t *previous = cinfo->event_mgr;
@@ -73,7 +37,7 @@ opj_event_mgr_t* OPJ_CALLCONV opj_set_event_mgr(opj_common_ptr cinfo, opj_event_
return NULL; return NULL;
} }
opj_bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ...) { bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ...) {
#define MSG_SIZE 512 /* 512 bytes should be more than enough for a short message */ #define MSG_SIZE 512 /* 512 bytes should be more than enough for a short message */
opj_msg_callback msg_handler = NULL; opj_msg_callback msg_handler = NULL;
@@ -93,29 +57,30 @@ opj_bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ..
break; break;
} }
if(msg_handler == NULL) { if(msg_handler == NULL) {
return OPJ_FALSE; return false;
} }
} else { } else {
return OPJ_FALSE; return false;
} }
if ((fmt != NULL) && (event_mgr != NULL)) { if ((fmt != NULL) && (event_mgr != NULL)) {
va_list arg; va_list arg;
int str_length/*, i, j*/; /* UniPG */ int str_length/*, i, j*/; /* UniPG */
char message[MSG_SIZE]; char message[MSG_SIZE];
memset(message, 0, MSG_SIZE);
/* initialize the optional parameter list */ /* initialize the optional parameter list */
va_start(arg, fmt); va_start(arg, fmt);
/* check the length of the format string */
str_length = (strlen(fmt) > MSG_SIZE) ? MSG_SIZE : strlen(fmt);
/* parse the format string and put the result in 'message' */ /* parse the format string and put the result in 'message' */
str_length = vsnprintf(message, MSG_SIZE, fmt, arg); /* UniPG */ vsprintf(message, fmt, arg); /* UniPG */
/* deinitialize the optional parameter list */ /* deinitialize the optional parameter list */
va_end(arg); va_end(arg);
/* output the message to the user program */ /* output the message to the user program */
if( str_length > -1 && str_length < MSG_SIZE ) msg_handler(message, cinfo->client_data);
msg_handler(message, cinfo->client_data);
else return OPJ_FALSE;
} }
return OPJ_TRUE; return true;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, Herve Drolon, FreeImage Team * Copyright (c) 2005, Herv<EFBFBD> Drolon, FreeImage Team
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,7 @@ Write formatted data to a string and send the string to a user callback.
@param fmt Format-control string (plus optionnal arguments) @param fmt Format-control string (plus optionnal arguments)
@return Returns true if successful, returns false otherwise @return Returns true if successful, returns false otherwise
*/ */
opj_bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ...); bool opj_event_msg(opj_common_ptr cinfo, int event_type, const char *fmt, ...);
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/*@}*/ /*@}*/

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, Herve Drolon, FreeImage Team * Copyright (c) 2005, Herv Drolon, FreeImage Team
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -28,6 +28,7 @@
opj_image_t* opj_image_create0(void) { opj_image_t* opj_image_create0(void) {
opj_image_t *image = (opj_image_t*)opj_calloc(1, sizeof(opj_image_t)); opj_image_t *image = (opj_image_t*)opj_calloc(1, sizeof(opj_image_t));
image->comps=NULL;
return image; return image;
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, Herve Drolon, FreeImage Team * Copyright (c) 2005, Herv<EFBFBD> Drolon, FreeImage Team
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

View File

@@ -1,118 +0,0 @@
/*
* $Id: indexbox_manager.h 897 2011-08-28 21:43:57Z Kaori.Hagihara@gmail.com $
*
* Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
* Copyright (c) 2002-2011, Professor Benoit Macq
* Copyright (c) 2003-2004, Yannick Verschueren
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*! \file
* \brief Modification of jpip.c from 2KAN indexer
*/
#ifndef INDEXBOX_MANAGER_H_
# define INDEXBOX_MANAGER_H_
#include "openjpeg.h"
#include "j2k.h" /* needed to use jp2.h */
#include "jp2.h"
#define JPIP_CIDX 0x63696478 /* Codestream index */
#define JPIP_CPTR 0x63707472 /* Codestream Finder Box */
#define JPIP_MANF 0x6d616e66 /* Manifest Box */
#define JPIP_FAIX 0x66616978 /* Fragment array Index box */
#define JPIP_MHIX 0x6d686978 /* Main Header Index Table */
#define JPIP_TPIX 0x74706978 /* Tile-part Index Table box */
#define JPIP_THIX 0x74686978 /* Tile header Index Table box */
#define JPIP_PPIX 0x70706978 /* Precinct Packet Index Table box */
#define JPIP_PHIX 0x70686978 /* Packet Header index Table */
#define JPIP_FIDX 0x66696478 /* File Index */
#define JPIP_FPTR 0x66707472 /* File Finder */
#define JPIP_PRXY 0x70727879 /* Proxy boxes */
#define JPIP_IPTR 0x69707472 /* Index finder box */
#define JPIP_PHLD 0x70686c64 /* Place holder */
/*
* Write tile-part Index table box (superbox)
*
* @param[in] coff offset of j2k codestream
* @param[in] cstr_info codestream information
* @param[in] j2klen length of j2k codestream
* @param[in] cio file output handle
* @return length of tpix box
*/
int write_tpix( int coff, opj_codestream_info_t cstr_info, int j2klen, opj_cio_t *cio);
/*
* Write tile header index table box (superbox)
*
* @param[in] coff offset of j2k codestream
* @param[in] cstr_info codestream information pointer
* @param[in] cio file output handle
* @return length of thix box
*/
int write_thix( int coff, opj_codestream_info_t cstr_info, opj_cio_t *cio);
/*
* Write precinct packet index table box (superbox)
*
* @param[in] coff offset of j2k codestream
* @param[in] cstr_info codestream information
* @param[in] EPHused true if EPH option used
* @param[in] j2klen length of j2k codestream
* @param[in] cio file output handle
* @return length of ppix box
*/
int write_ppix( int coff, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio);
/*
* Write packet header index table box (superbox)
*
* @param[in] coff offset of j2k codestream
* @param[in] cstr_info codestream information
* @param[in] EPHused true if EPH option used
* @param[in] j2klen length of j2k codestream
* @param[in] cio file output handle
* @return length of ppix box
*/
int write_phix( int coff, opj_codestream_info_t cstr_info, opj_bool EPHused, int j2klen, opj_cio_t *cio);
/*
* Wriet manifest box (box)
*
* @param[in] second number to be visited
* @param[in] v number of boxes
* @param[in] box box to be manifested
* @param[in] cio file output handle
*/
void write_manf(int second, int v, opj_jp2_box_t *box, opj_cio_t *cio);
#endif /* !INDEXBOX_MANAGER_H_ */

View File

@@ -6,7 +6,6 @@
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
* Copyright (c) 2005, Herve Drolon, FreeImage Team * Copyright (c) 2005, Herve Drolon, FreeImage Team
* Copyright (c) 2006-2007, Parvatha Elangovan * Copyright (c) 2006-2007, Parvatha Elangovan
* Copyright (c) 2010-2011, Kaori Hagihara
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -229,23 +228,6 @@ Read an unknown marker
@param j2k J2K handle @param j2k J2K handle
*/ */
static void j2k_read_unk(opj_j2k_t *j2k); static void j2k_read_unk(opj_j2k_t *j2k);
/**
Add main header marker information
@param cstr_info Codestream information structure
@param type marker type
@param pos byte offset of marker segment
@param len length of marker segment
*/
static void j2k_add_mhmarker(opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len);
/**
Add tile header marker information
@param tileno tile index number
@param cstr_info Codestream information structure
@param type marker type
@param pos byte offset of marker segment
@param len length of marker segment
*/
static void j2k_add_tlmarker( int tileno, opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len);
/*@}*/ /*@}*/
@@ -276,6 +258,80 @@ char *j2k_convert_progression_order(OPJ_PROG_ORDER prg_order){
return po->str_prog; return po->str_prog;
} }
void j2k_dump_image(FILE *fd, opj_image_t * img) {
int compno;
fprintf(fd, "image {\n");
fprintf(fd, " x0=%d, y0=%d, x1=%d, y1=%d\n", img->x0, img->y0, img->x1, img->y1);
fprintf(fd, " numcomps=%d\n", img->numcomps);
for (compno = 0; compno < img->numcomps; compno++) {
opj_image_comp_t *comp = &img->comps[compno];
fprintf(fd, " comp %d {\n", compno);
fprintf(fd, " dx=%d, dy=%d\n", comp->dx, comp->dy);
fprintf(fd, " prec=%d\n", comp->prec);
//fprintf(fd, " bpp=%d\n", comp->bpp);
fprintf(fd, " sgnd=%d\n", comp->sgnd);
fprintf(fd, " }\n");
}
fprintf(fd, "}\n");
}
void j2k_dump_cp(FILE *fd, opj_image_t * img, opj_cp_t * cp) {
int tileno, compno, layno, bandno, resno, numbands;
fprintf(fd, "coding parameters {\n");
fprintf(fd, " tx0=%d, ty0=%d\n", cp->tx0, cp->ty0);
fprintf(fd, " tdx=%d, tdy=%d\n", cp->tdx, cp->tdy);
fprintf(fd, " tw=%d, th=%d\n", cp->tw, cp->th);
for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {
opj_tcp_t *tcp = &cp->tcps[tileno];
fprintf(fd, " tile %d {\n", tileno);
fprintf(fd, " csty=%x\n", tcp->csty);
fprintf(fd, " prg=%d\n", tcp->prg);
fprintf(fd, " numlayers=%d\n", tcp->numlayers);
fprintf(fd, " mct=%d\n", tcp->mct);
fprintf(fd, " rates=");
for (layno = 0; layno < tcp->numlayers; layno++) {
fprintf(fd, "%.1f ", tcp->rates[layno]);
}
fprintf(fd, "\n");
for (compno = 0; compno < img->numcomps; compno++) {
opj_tccp_t *tccp = &tcp->tccps[compno];
fprintf(fd, " comp %d {\n", compno);
fprintf(fd, " csty=%x\n", tccp->csty);
fprintf(fd, " numresolutions=%d\n", tccp->numresolutions);
fprintf(fd, " cblkw=%d\n", tccp->cblkw);
fprintf(fd, " cblkh=%d\n", tccp->cblkh);
fprintf(fd, " cblksty=%x\n", tccp->cblksty);
fprintf(fd, " qmfbid=%d\n", tccp->qmfbid);
fprintf(fd, " qntsty=%d\n", tccp->qntsty);
fprintf(fd, " numgbits=%d\n", tccp->numgbits);
fprintf(fd, " roishift=%d\n", tccp->roishift);
fprintf(fd, " stepsizes=");
numbands = tccp->qntsty == J2K_CCP_QNTSTY_SIQNT ? 1 : tccp->numresolutions * 3 - 2;
for (bandno = 0; bandno < numbands; bandno++) {
fprintf(fd, "(%d,%d) ", tccp->stepsizes[bandno].mant,
tccp->stepsizes[bandno].expn);
}
fprintf(fd, "\n");
if (tccp->csty & J2K_CCP_CSTY_PRT) {
fprintf(fd, " prcw=");
for (resno = 0; resno < tccp->numresolutions; resno++) {
fprintf(fd, "%d ", tccp->prcw[resno]);
}
fprintf(fd, "\n");
fprintf(fd, " prch=");
for (resno = 0; resno < tccp->numresolutions; resno++) {
fprintf(fd, "%d ", tccp->prch[resno]);
}
fprintf(fd, "\n");
}
fprintf(fd, " }\n");
}
fprintf(fd, " }\n");
}
fprintf(fd, "}\n");
}
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
static int j2k_get_num_tp(opj_cp_t *cp,int pino,int tileno){ static int j2k_get_num_tp(opj_cp_t *cp,int pino,int tileno){
char *prog; char *prog;
@@ -315,9 +371,6 @@ static int j2k_get_num_tp(opj_cp_t *cp,int pino,int tileno){
/** mem allocation for TLM marker*/ /** mem allocation for TLM marker*/
int j2k_calculate_tp(opj_cp_t *cp,int img_numcomp,opj_image_t *image,opj_j2k_t *j2k ){ int j2k_calculate_tp(opj_cp_t *cp,int img_numcomp,opj_image_t *image,opj_j2k_t *j2k ){
int pino,tileno,totnum_tp=0; int pino,tileno,totnum_tp=0;
OPJ_ARG_NOT_USED(img_numcomp);
j2k->cur_totnum_tp = (int *) opj_malloc(cp->tw * cp->th * sizeof(int)); j2k->cur_totnum_tp = (int *) opj_malloc(cp->tw * cp->th * sizeof(int));
for (tileno = 0; tileno < cp->tw * cp->th; tileno++) { for (tileno = 0; tileno < cp->tw * cp->th; tileno++) {
int cur_totnum_tp = 0; int cur_totnum_tp = 0;
@@ -346,14 +399,12 @@ static void j2k_write_soc(opj_j2k_t *j2k) {
opj_cio_t *cio = j2k->cio; opj_cio_t *cio = j2k->cio;
cio_write(cio, J2K_MS_SOC, 2); cio_write(cio, J2K_MS_SOC, 2);
if(j2k->cstr_info)
j2k_add_mhmarker(j2k->cstr_info, J2K_MS_SOC, cio_tell(cio), 0);
/* UniPG>> */ /* UniPG>> */
#ifdef USE_JPWL #ifdef USE_JPWL
/* update markers struct */ /* update markers struct */
j2k_add_marker(j2k->cstr_info, J2K_MS_SOC, cio_tell(cio) - 2, 2); j2k_add_marker(j2k->cstr_info, J2K_MS_SOC, cio_tell(cio) - 2, 2);
#endif /* USE_JPWL */ #endif /* USE_JPWL */
/* <<UniPG */ /* <<UniPG */
} }
@@ -374,7 +425,7 @@ static void j2k_write_siz(opj_j2k_t *j2k) {
opj_cio_t *cio = j2k->cio; opj_cio_t *cio = j2k->cio;
opj_image_t *image = j2k->image; opj_image_t *image = j2k->image;
opj_cp_t *cp = j2k->cp; opj_cp_t *cp = j2k->cp;
cio_write(cio, J2K_MS_SIZ, 2); /* SIZ */ cio_write(cio, J2K_MS_SIZ, 2); /* SIZ */
lenp = cio_tell(cio); lenp = cio_tell(cio);
cio_skip(cio, 2); cio_skip(cio, 2);
@@ -397,9 +448,6 @@ static void j2k_write_siz(opj_j2k_t *j2k) {
cio_seek(cio, lenp); cio_seek(cio, lenp);
cio_write(cio, len, 2); /* Lsiz */ cio_write(cio, len, 2); /* Lsiz */
cio_seek(cio, lenp + len); cio_seek(cio, lenp + len);
if(j2k->cstr_info)
j2k_add_mhmarker(j2k->cstr_info, J2K_MS_SIZ, lenp, len);
} }
static void j2k_read_siz(opj_j2k_t *j2k) { static void j2k_read_siz(opj_j2k_t *j2k) {
@@ -468,12 +516,6 @@ static void j2k_read_siz(opj_j2k_t *j2k) {
} }
#endif /* USE_JPWL */ #endif /* USE_JPWL */
/* prevent division by zero */
if (!(cp->tdx * cp->tdy)) {
opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: invalid tile size (tdx: %d, tdy: %d)\n", cp->tdx, cp->tdy);
return;
}
image->comps = (opj_image_comp_t*) opj_calloc(image->numcomps, sizeof(opj_image_comp_t)); image->comps = (opj_image_comp_t*) opj_calloc(image->numcomps, sizeof(opj_image_comp_t));
for (i = 0; i < image->numcomps; i++) { for (i = 0; i < image->numcomps; i++) {
int tmp, w, h; int tmp, w, h;
@@ -512,12 +554,6 @@ static void j2k_read_siz(opj_j2k_t *j2k) {
} }
#endif /* USE_JPWL */ #endif /* USE_JPWL */
/* prevent division by zero */
if (!(image->comps[i].dx * image->comps[i].dy)) {
opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: invalid component size (dx: %d, dy: %d)\n", image->comps[i].dx, image->comps[i].dy);
return;
}
/* TODO: unused ? */ /* TODO: unused ? */
w = int_ceildiv(image->x1 - image->x0, image->comps[i].dx); w = int_ceildiv(image->x1 - image->x0, image->comps[i].dx);
h = int_ceildiv(image->y1 - image->y0, image->comps[i].dy); h = int_ceildiv(image->y1 - image->y0, image->comps[i].dy);
@@ -570,17 +606,7 @@ static void j2k_read_siz(opj_j2k_t *j2k) {
#endif /* USE_JPWL */ #endif /* USE_JPWL */
cp->tcps = (opj_tcp_t*) opj_calloc(cp->tw * cp->th, sizeof(opj_tcp_t)); cp->tcps = (opj_tcp_t*) opj_calloc(cp->tw * cp->th, sizeof(opj_tcp_t));
if (cp->tcps == NULL)
{
opj_event_msg(j2k->cinfo, EVT_ERROR, "Out of memory\n");
return;
}
cp->tileno = (int*) opj_malloc(cp->tw * cp->th * sizeof(int)); cp->tileno = (int*) opj_malloc(cp->tw * cp->th * sizeof(int));
if (cp->tileno == NULL)
{
opj_event_msg(j2k->cinfo, EVT_ERROR, "Out of memory\n");
return;
}
cp->tileno_size = 0; cp->tileno_size = 0;
#ifdef USE_JPWL #ifdef USE_JPWL
@@ -652,11 +678,6 @@ static void j2k_write_com(opj_j2k_t *j2k) {
cio_seek(cio, lenp); cio_seek(cio, lenp);
cio_write(cio, len, 2); cio_write(cio, len, 2);
cio_seek(cio, lenp + len); cio_seek(cio, lenp + len);
if(j2k->cstr_info)
j2k_add_mhmarker(j2k->cstr_info, J2K_MS_COM, lenp, len);
} }
} }
@@ -700,18 +721,12 @@ static void j2k_read_cox(opj_j2k_t *j2k, int compno) {
tccp->numresolutions = cio_read(cio, 1) + 1; /* SPcox (D) */ tccp->numresolutions = cio_read(cio, 1) + 1; /* SPcox (D) */
/* If user wants to remove more resolutions than the codestream contains, return error*/ // If user wants to remove more resolutions than the codestream contains, return error
if (cp->reduce >= tccp->numresolutions) { if (cp->reduce >= tccp->numresolutions) {
opj_event_msg(j2k->cinfo, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions to remove is higher than the number " opj_event_msg(j2k->cinfo, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions to remove is higher than the number "
"of resolutions of this component\nModify the cp_reduce parameter.\n\n", compno); "of resolutions of this component\nModify the cp_reduce parameter.\n\n", compno);
j2k->state |= J2K_STATE_ERR; j2k->state |= J2K_STATE_ERR;
} }
if( tccp->numresolutions > J2K_MAXRLVLS ) {
opj_event_msg(j2k->cinfo, EVT_ERROR, "Error decoding component %d.\nThe number of resolutions is too big: %d vs max= %d. Truncating.\n\n",
compno, tccp->numresolutions, J2K_MAXRLVLS);
j2k->state |= J2K_STATE_ERR;
tccp->numresolutions = J2K_MAXRLVLS;
}
tccp->cblkw = cio_read(cio, 1) + 2; /* SPcox (E) */ tccp->cblkw = cio_read(cio, 1) + 2; /* SPcox (E) */
tccp->cblkh = cio_read(cio, 1) + 2; /* SPcox (F) */ tccp->cblkh = cio_read(cio, 1) + 2; /* SPcox (F) */
@@ -766,10 +781,6 @@ static void j2k_write_cod(opj_j2k_t *j2k) {
cio_seek(cio, lenp); cio_seek(cio, lenp);
cio_write(cio, len, 2); /* Lcod */ cio_write(cio, len, 2); /* Lcod */
cio_seek(cio, lenp + len); cio_seek(cio, lenp + len);
if(j2k->cstr_info)
j2k_add_mhmarker(j2k->cstr_info, J2K_MS_COD, lenp, len);
} }
static void j2k_read_cod(opj_j2k_t *j2k) { static void j2k_read_cod(opj_j2k_t *j2k) {
@@ -835,12 +846,6 @@ static void j2k_read_coc(opj_j2k_t *j2k) {
len = cio_read(cio, 2); /* Lcoc */ len = cio_read(cio, 2); /* Lcoc */
compno = cio_read(cio, image->numcomps <= 256 ? 1 : 2); /* Ccoc */ compno = cio_read(cio, image->numcomps <= 256 ? 1 : 2); /* Ccoc */
if (compno >= image->numcomps) {
opj_event_msg(j2k->cinfo, EVT_ERROR,
"bad component number in COC (%d out of a maximum of %d)\n",
compno, image->numcomps);
return;
}
tcp->tccps[compno].csty = cio_read(cio, 1); /* Scoc */ tcp->tccps[compno].csty = cio_read(cio, 1); /* Scoc */
j2k_read_cox(j2k, compno); j2k_read_cox(j2k, compno);
} }
@@ -904,15 +909,6 @@ static void j2k_read_qcx(opj_j2k_t *j2k, int compno, int len) {
}; };
}; };
#else
/* We check whether there are too many subbands */
if ((numbands < 0) || (numbands >= J2K_MAXBANDS)) {
opj_event_msg(j2k->cinfo, EVT_WARNING ,
"bad number of subbands in Sqcx (%d) regarding to J2K_MAXBANDS (%d) \n"
"- limiting number of bands to J2K_MAXBANDS and try to move to the next markers\n", numbands, J2K_MAXBANDS);
}
#endif /* USE_JPWL */ #endif /* USE_JPWL */
for (bandno = 0; bandno < numbands; bandno++) { for (bandno = 0; bandno < numbands; bandno++) {
@@ -925,10 +921,8 @@ static void j2k_read_qcx(opj_j2k_t *j2k, int compno, int len) {
expn = tmp >> 11; expn = tmp >> 11;
mant = tmp & 0x7ff; mant = tmp & 0x7ff;
} }
if (bandno < J2K_MAXBANDS){ tccp->stepsizes[bandno].expn = expn;
tccp->stepsizes[bandno].expn = expn; tccp->stepsizes[bandno].mant = mant;
tccp->stepsizes[bandno].mant = mant;
}
} }
/* Add Antonin : if scalar_derived -> compute other stepsizes */ /* Add Antonin : if scalar_derived -> compute other stepsizes */
@@ -956,9 +950,6 @@ static void j2k_write_qcd(opj_j2k_t *j2k) {
cio_seek(cio, lenp); cio_seek(cio, lenp);
cio_write(cio, len, 2); /* Lqcd */ cio_write(cio, len, 2); /* Lqcd */
cio_seek(cio, lenp + len); cio_seek(cio, lenp + len);
if(j2k->cstr_info)
j2k_add_mhmarker(j2k->cstr_info, J2K_MS_QCD, lenp, len);
} }
static void j2k_read_qcd(opj_j2k_t *j2k) { static void j2k_read_qcd(opj_j2k_t *j2k) {
@@ -995,7 +986,7 @@ static void j2k_read_qcc(opj_j2k_t *j2k) {
int len, compno; int len, compno;
int numcomp = j2k->image->numcomps; int numcomp = j2k->image->numcomps;
opj_cio_t *cio = j2k->cio; opj_cio_t *cio = j2k->cio;
len = cio_read(cio, 2); /* Lqcc */ len = cio_read(cio, 2); /* Lqcc */
compno = cio_read(cio, numcomp <= 256 ? 1 : 2); /* Cqcc */ compno = cio_read(cio, numcomp <= 256 ? 1 : 2); /* Cqcc */
@@ -1022,16 +1013,9 @@ static void j2k_read_qcc(opj_j2k_t *j2k) {
/* keep your private count of tiles */ /* keep your private count of tiles */
backup_compno++; backup_compno++;
} };
#endif /* USE_JPWL */ #endif /* USE_JPWL */
if ((compno < 0) || (compno >= numcomp)) {
opj_event_msg(j2k->cinfo, EVT_ERROR,
"bad component number in QCC (%d out of a maximum of %d)\n",
compno, j2k->image->numcomps);
return;
}
j2k_read_qcx(j2k, compno, len - 2 - (numcomp <= 256 ? 1 : 2)); j2k_read_qcx(j2k, compno, len - 2 - (numcomp <= 256 ? 1 : 2));
} }
@@ -1287,10 +1271,6 @@ static void j2k_write_sot(opj_j2k_t *j2k) {
j2k_add_marker(j2k->cstr_info, J2K_MS_SOT, j2k->sot_start, len + 2); j2k_add_marker(j2k->cstr_info, J2K_MS_SOT, j2k->sot_start, len + 2);
#endif /* USE_JPWL */ #endif /* USE_JPWL */
/* <<UniPG */ /* <<UniPG */
if( j2k->cstr_info && j2k->cur_tp_num==0){
j2k_add_tlmarker( j2k->curtileno, j2k->cstr_info, J2K_MS_SOT, lenp, len);
}
} }
static void j2k_read_sot(opj_j2k_t *j2k) { static void j2k_read_sot(opj_j2k_t *j2k) {
@@ -1374,11 +1354,6 @@ static void j2k_read_sot(opj_j2k_t *j2k) {
partno = cio_read(cio, 1); partno = cio_read(cio, 1);
numparts = cio_read(cio, 1); numparts = cio_read(cio, 1);
if (partno >= numparts) {
opj_event_msg(j2k->cinfo, EVT_WARNING, "SOT marker inconsistency in tile %d: tile-part index greater (%d) than number of tile-parts (%d)\n", tileno, partno, numparts);
numparts = partno+1;
}
j2k->curtileno = tileno; j2k->curtileno = tileno;
j2k->cur_tp_num = partno; j2k->cur_tp_num = partno;
@@ -1394,14 +1369,15 @@ static void j2k_read_sot(opj_j2k_t *j2k) {
j2k->cstr_info->tile[tileno].tileno = tileno; j2k->cstr_info->tile[tileno].tileno = tileno;
j2k->cstr_info->tile[tileno].start_pos = cio_tell(cio) - 12; j2k->cstr_info->tile[tileno].start_pos = cio_tell(cio) - 12;
j2k->cstr_info->tile[tileno].end_pos = j2k->cstr_info->tile[tileno].start_pos + totlen - 1; j2k->cstr_info->tile[tileno].end_pos = j2k->cstr_info->tile[tileno].start_pos + totlen - 1;
} else { j2k->cstr_info->tile[tileno].num_tps = numparts;
j2k->cstr_info->tile[tileno].end_pos += totlen; if (numparts)
j2k->cstr_info->tile[tileno].tp = (opj_tp_info_t *) opj_malloc(numparts * sizeof(opj_tp_info_t));
else
j2k->cstr_info->tile[tileno].tp = (opj_tp_info_t *) opj_malloc(10 * sizeof(opj_tp_info_t)); // Fixme (10)
} }
j2k->cstr_info->tile[tileno].num_tps = numparts; else {
if (numparts) j2k->cstr_info->tile[tileno].end_pos += totlen;
j2k->cstr_info->tile[tileno].tp = (opj_tp_info_t *) opj_realloc(j2k->cstr_info->tile[tileno].tp, numparts * sizeof(opj_tp_info_t)); }
else
j2k->cstr_info->tile[tileno].tp = (opj_tp_info_t *) opj_realloc(j2k->cstr_info->tile[tileno].tp, 10 * sizeof(opj_tp_info_t)); /* Fixme (10)*/
j2k->cstr_info->tile[tileno].tp[partno].tp_start_pos = cio_tell(cio) - 12; j2k->cstr_info->tile[tileno].tp[partno].tp_start_pos = cio_tell(cio) - 12;
j2k->cstr_info->tile[tileno].tp[partno].tp_end_pos = j2k->cstr_info->tile[tileno].tp[partno].tp_end_pos =
j2k->cstr_info->tile[tileno].tp[partno].tp_start_pos + totlen - 1; j2k->cstr_info->tile[tileno].tp[partno].tp_start_pos + totlen - 1;
@@ -1437,11 +1413,6 @@ static void j2k_write_sod(opj_j2k_t *j2k, void *tile_coder) {
tcd->cur_tp_num = j2k->cur_tp_num; tcd->cur_tp_num = j2k->cur_tp_num;
cio_write(cio, J2K_MS_SOD, 2); cio_write(cio, J2K_MS_SOD, 2);
if( j2k->cstr_info && j2k->cur_tp_num==0){
j2k_add_tlmarker( j2k->curtileno, j2k->cstr_info, J2K_MS_SOD, cio_tell(cio), 0);
}
if (j2k->curtileno == 0) { if (j2k->curtileno == 0) {
j2k->sod_start = cio_tell(cio) + j2k->pos_correction; j2k->sod_start = cio_tell(cio) + j2k->pos_correction;
} }
@@ -1516,7 +1487,7 @@ static void j2k_read_sod(opj_j2k_t *j2k) {
if (len == cio_numbytesleft(cio) + 1) { if (len == cio_numbytesleft(cio) + 1) {
truncate = 1; /* Case of a truncate codestream */ truncate = 1; /* Case of a truncate codestream */
} }
data = j2k->tile_data[curtileno]; data = j2k->tile_data[curtileno];
data = (unsigned char*) opj_realloc(data, (j2k->tile_len[curtileno] + len) * sizeof(unsigned char)); data = (unsigned char*) opj_realloc(data, (j2k->tile_len[curtileno] + len) * sizeof(unsigned char));
@@ -1577,13 +1548,6 @@ static void j2k_read_rgn(opj_j2k_t *j2k) {
}; };
#endif /* USE_JPWL */ #endif /* USE_JPWL */
if (compno >= numcomps) {
opj_event_msg(j2k->cinfo, EVT_ERROR,
"bad component number in RGN (%d out of a maximum of %d)\n",
compno, j2k->image->numcomps);
return;
}
tcp->tccps[compno].roishift = cio_read(cio, 1); /* SPrgn */ tcp->tccps[compno].roishift = cio_read(cio, 1); /* SPrgn */
} }
@@ -1602,7 +1566,7 @@ static void j2k_write_eoc(opj_j2k_t *j2k) {
static void j2k_read_eoc(opj_j2k_t *j2k) { static void j2k_read_eoc(opj_j2k_t *j2k) {
int i, tileno; int i, tileno;
opj_bool success = OPJ_FALSE; bool success;
/* if packets should be decoded */ /* if packets should be decoded */
if (j2k->cp->limit_decoding != DECODE_ALL_BUT_PACKETS) { if (j2k->cp->limit_decoding != DECODE_ALL_BUT_PACKETS) {
@@ -1610,17 +1574,12 @@ static void j2k_read_eoc(opj_j2k_t *j2k) {
tcd_malloc_decode(tcd, j2k->image, j2k->cp); tcd_malloc_decode(tcd, j2k->image, j2k->cp);
for (i = 0; i < j2k->cp->tileno_size; i++) { for (i = 0; i < j2k->cp->tileno_size; i++) {
tcd_malloc_decode_tile(tcd, j2k->image, j2k->cp, i, j2k->cstr_info); tcd_malloc_decode_tile(tcd, j2k->image, j2k->cp, i, j2k->cstr_info);
if (j2k->cp->tileno[i] != -1) tileno = j2k->cp->tileno[i];
{ success = tcd_decode_tile(tcd, j2k->tile_data[tileno], j2k->tile_len[tileno], tileno, j2k->cstr_info);
tileno = j2k->cp->tileno[i]; opj_free(j2k->tile_data[tileno]);
success = tcd_decode_tile(tcd, j2k->tile_data[tileno], j2k->tile_len[tileno], tileno, j2k->cstr_info); j2k->tile_data[tileno] = NULL;
opj_free(j2k->tile_data[tileno]); tcd_free_decode_tile(tcd, i);
j2k->tile_data[tileno] = NULL; if (success == false) {
tcd_free_decode_tile(tcd, i);
}
else
success = OPJ_FALSE;
if (success == OPJ_FALSE) {
j2k->state |= J2K_STATE_ERR; j2k->state |= J2K_STATE_ERR;
break; break;
} }
@@ -1790,14 +1749,6 @@ void j2k_destroy_decompress(opj_j2k_t *j2k) {
opj_free(j2k->tile_len); opj_free(j2k->tile_len);
} }
if(j2k->tile_data != NULL) { if(j2k->tile_data != NULL) {
if(j2k->cp != NULL) {
for (i = 0; i < j2k->cp->tileno_size; i++) {
int tileno = j2k->cp->tileno[i];
opj_free(j2k->tile_data[tileno]);
j2k->tile_data[tileno] = NULL;
}
}
opj_free(j2k->tile_data); opj_free(j2k->tile_data);
} }
if(j2k->default_tcp != NULL) { if(j2k->default_tcp != NULL) {
@@ -1883,7 +1834,7 @@ opj_image_t* j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *c
if (j2k->cp->correct) { if (j2k->cp->correct) {
int orig_pos = cio_tell(cio); int orig_pos = cio_tell(cio);
opj_bool status; bool status;
/* call the corrector */ /* call the corrector */
status = jpwl_correct(j2k); status = jpwl_correct(j2k);
@@ -1922,13 +1873,13 @@ opj_image_t* j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *c
return 0; return 0;
} }
e = j2k_dec_mstab_lookup(id); e = j2k_dec_mstab_lookup(id);
/* Check if the marker is known*/ // Check if the marker is known
if (!(j2k->state & e->states)) { if (!(j2k->state & e->states)) {
opj_image_destroy(image); opj_image_destroy(image);
opj_event_msg(cinfo, EVT_ERROR, "%.8x: unexpected marker %x\n", cio_tell(cio) - 2, id); opj_event_msg(cinfo, EVT_ERROR, "%.8x: unexpected marker %x\n", cio_tell(cio) - 2, id);
return 0; return 0;
} }
/* Check if the decoding is limited to the main header*/ // Check if the decoding is limited to the main header
if (e->id == J2K_MS_SOT && j2k->cp->limit_decoding == LIMIT_TO_MAIN_HEADER) { if (e->id == J2K_MS_SOT && j2k->cp->limit_decoding == LIMIT_TO_MAIN_HEADER) {
opj_event_msg(cinfo, EVT_INFO, "Main Header decoded.\n"); opj_event_msg(cinfo, EVT_INFO, "Main Header decoded.\n");
return image; return image;
@@ -1938,10 +1889,7 @@ opj_image_t* j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *c
(*e->handler)(j2k); (*e->handler)(j2k);
} }
if (j2k->state & J2K_STATE_ERR) if (j2k->state & J2K_STATE_ERR)
{
opj_image_destroy(image);
return NULL; return NULL;
}
if (j2k->state == J2K_STATE_MT) { if (j2k->state == J2K_STATE_MT) {
break; break;
@@ -1957,6 +1905,7 @@ opj_image_t* j2k_decode(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestream_info_t *c
if (j2k->state != J2K_STATE_MT) { if (j2k->state != J2K_STATE_MT) {
opj_event_msg(cinfo, EVT_WARNING, "Incomplete bitstream\n"); opj_event_msg(cinfo, EVT_WARNING, "Incomplete bitstream\n");
} }
return image; return image;
} }
@@ -1968,10 +1917,9 @@ opj_image_t* j2k_decode_jpt_stream(opj_j2k_t *j2k, opj_cio_t *cio, opj_codestre
opj_image_t *image = NULL; opj_image_t *image = NULL;
opj_jpt_msg_header_t header; opj_jpt_msg_header_t header;
int position; int position;
opj_common_ptr cinfo = j2k->cinfo; opj_common_ptr cinfo = j2k->cinfo;
OPJ_ARG_NOT_USED(cstr_info);
j2k->cio = cio; j2k->cio = cio;
/* create an empty image */ /* create an empty image */
@@ -2162,12 +2110,12 @@ void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_
int i; int i;
/* set JPWL on */ /* set JPWL on */
cp->epc_on = OPJ_TRUE; cp->epc_on = true;
cp->info_on = OPJ_FALSE; /* no informative technique */ cp->info_on = false; /* no informative technique */
/* set EPB on */ /* set EPB on */
if ((parameters->jpwl_hprot_MH > 0) || (parameters->jpwl_hprot_TPH[0] > 0)) { if ((parameters->jpwl_hprot_MH > 0) || (parameters->jpwl_hprot_TPH[0] > 0)) {
cp->epb_on = OPJ_TRUE; cp->epb_on = true;
cp->hprot_MH = parameters->jpwl_hprot_MH; cp->hprot_MH = parameters->jpwl_hprot_MH;
for (i = 0; i < JPWL_MAX_NO_TILESPECS; i++) { for (i = 0; i < JPWL_MAX_NO_TILESPECS; i++) {
@@ -2188,7 +2136,7 @@ void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_
/* set ESD writing */ /* set ESD writing */
if ((parameters->jpwl_sens_size == 1) || (parameters->jpwl_sens_size == 2)) { if ((parameters->jpwl_sens_size == 1) || (parameters->jpwl_sens_size == 2)) {
cp->esd_on = OPJ_TRUE; cp->esd_on = true;
cp->sens_size = parameters->jpwl_sens_size; cp->sens_size = parameters->jpwl_sens_size;
cp->sens_addr = parameters->jpwl_sens_addr; cp->sens_addr = parameters->jpwl_sens_addr;
@@ -2202,10 +2150,10 @@ void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_
} }
/* always set RED writing to false: we are at the encoder */ /* always set RED writing to false: we are at the encoder */
cp->red_on = OPJ_FALSE; cp->red_on = false;
} else { } else {
cp->epc_on = OPJ_FALSE; cp->epc_on = false;
} }
#endif /* USE_JPWL */ #endif /* USE_JPWL */
@@ -2278,10 +2226,10 @@ void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_
if(parameters->cp_cinema) if(parameters->cp_cinema)
{ {
/*Precinct size for lowest frequency subband=128*/ //Precinct size for lowest frequency subband=128
tccp->prcw[0] = 7; tccp->prcw[0] = 7;
tccp->prch[0] = 7; tccp->prch[0] = 7;
/*Precinct size at all other resolutions = 256*/ //Precinct size at all other resolutions = 256
for (j = 1; j < tccp->numresolutions; j++) { for (j = 1; j < tccp->numresolutions; j++) {
tccp->prcw[j] = 8; tccp->prcw[j] = 8;
tccp->prch[j] = 8; tccp->prch[j] = 8;
@@ -2323,7 +2271,7 @@ void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_
} }
p++; p++;
/*printf("\nsize precinct for level %d : %d,%d\n", j,tccp->prcw[j], tccp->prch[j]); */ /*printf("\nsize precinct for level %d : %d,%d\n", j,tccp->prcw[j], tccp->prch[j]); */
} /*end for*/ } //end for
} else { } else {
for (j = 0; j < tccp->numresolutions; j++) { for (j = 0; j < tccp->numresolutions; j++) {
tccp->prcw[j] = 15; tccp->prcw[j] = 15;
@@ -2337,7 +2285,7 @@ void j2k_setup_encoder(opj_j2k_t *j2k, opj_cparameters_t *parameters, opj_image_
} }
} }
opj_bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info) { bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info) {
int tileno, compno; int tileno, compno;
opj_cp_t *cp = NULL; opj_cp_t *cp = NULL;
@@ -2348,6 +2296,8 @@ opj_bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_code
cp = j2k->cp; cp = j2k->cp;
/* j2k_dump_cp(stdout, image, cp); */
/* INDEX >> */ /* INDEX >> */
j2k->cstr_info = cstr_info; j2k->cstr_info = cstr_info;
if (cstr_info) { if (cstr_info) {
@@ -2444,9 +2394,6 @@ opj_bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_code
/* INDEX >> */ /* INDEX >> */
if(cstr_info) { if(cstr_info) {
cstr_info->tile[j2k->curtileno].start_pos = cio_tell(cio) + j2k->pos_correction; cstr_info->tile[j2k->curtileno].start_pos = cio_tell(cio) + j2k->pos_correction;
cstr_info->tile[j2k->curtileno].maxmarknum = 10;
cstr_info->tile[j2k->curtileno].marker = (opj_marker_info_t *) opj_malloc(cstr_info->tile[j2k->curtileno].maxmarknum * sizeof(opj_marker_info_t));
cstr_info->tile[j2k->curtileno].marknum = 0;
} }
/* << INDEX */ /* << INDEX */
@@ -2553,46 +2500,11 @@ opj_bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_code
} }
#endif /* USE_JPWL */ #endif /* USE_JPWL */
return OPJ_TRUE; return true;
} }
static void j2k_add_mhmarker(opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len) {
if (!cstr_info)
return;
/* expand the list? */
if ((cstr_info->marknum + 1) > cstr_info->maxmarknum) {
cstr_info->maxmarknum = 100 + (int) ((float) cstr_info->maxmarknum * 1.0F);
cstr_info->marker = (opj_marker_info_t*)opj_realloc(cstr_info->marker, cstr_info->maxmarknum);
}
/* add the marker */
cstr_info->marker[cstr_info->marknum].type = type;
cstr_info->marker[cstr_info->marknum].pos = pos;
cstr_info->marker[cstr_info->marknum].len = len;
cstr_info->marknum++;
}
static void j2k_add_tlmarker( int tileno, opj_codestream_info_t *cstr_info, unsigned short int type, int pos, int len) {
opj_marker_info_t *marker;
if (!cstr_info)
return;
/* expand the list? */
if ((cstr_info->tile[tileno].marknum + 1) > cstr_info->tile[tileno].maxmarknum) {
cstr_info->tile[tileno].maxmarknum = 100 + (int) ((float) cstr_info->tile[tileno].maxmarknum * 1.0F);
cstr_info->tile[tileno].marker = (opj_marker_info_t*)opj_realloc(cstr_info->tile[tileno].marker, cstr_info->maxmarknum);
}
marker = &(cstr_info->tile[tileno].marker[cstr_info->tile[tileno].marknum]);
/* add the marker */
marker->type = type;
marker->pos = pos;
marker->len = len;
cstr_info->tile[tileno].marknum++;
}

View File

@@ -265,15 +265,15 @@ typedef struct opj_cp {
/* UniPG>> */ /* UniPG>> */
#ifdef USE_JPWL #ifdef USE_JPWL
/** enables writing of EPC in MH, thus activating JPWL */ /** enables writing of EPC in MH, thus activating JPWL */
opj_bool epc_on; bool epc_on;
/** enables writing of EPB, in case of activated JPWL */ /** enables writing of EPB, in case of activated JPWL */
opj_bool epb_on; bool epb_on;
/** enables writing of ESD, in case of activated JPWL */ /** enables writing of ESD, in case of activated JPWL */
opj_bool esd_on; bool esd_on;
/** enables writing of informative techniques of ESD, in case of activated JPWL */ /** enables writing of informative techniques of ESD, in case of activated JPWL */
opj_bool info_on; bool info_on;
/** enables writing of RED, in case of activated JPWL */ /** enables writing of RED, in case of activated JPWL */
opj_bool red_on; bool red_on;
/** error protection method for MH (0,1,16,32,37-128) */ /** error protection method for MH (0,1,16,32,37-128) */
int hprot_MH; int hprot_MH;
/** tile number of header protection specification (>=0) */ /** tile number of header protection specification (>=0) */
@@ -299,7 +299,7 @@ typedef struct opj_cp {
/** sensitivity methods for TPHs (-1,0-7) */ /** sensitivity methods for TPHs (-1,0-7) */
int sens_TPH[JPWL_MAX_NO_TILESPECS]; int sens_TPH[JPWL_MAX_NO_TILESPECS];
/** enables JPWL correction at the decoder */ /** enables JPWL correction at the decoder */
opj_bool correct; bool correct;
/** expected number of components at the decoder */ /** expected number of components at the decoder */
int exp_comps; int exp_comps;
/** maximum number of tiles at the decoder */ /** maximum number of tiles at the decoder */
@@ -436,8 +436,10 @@ Encode an image into a JPEG-2000 codestream
@param cstr_info Codestream information structure if required, NULL otherwise @param cstr_info Codestream information structure if required, NULL otherwise
@return Returns true if successful, returns false otherwise @return Returns true if successful, returns false otherwise
*/ */
opj_bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info); bool j2k_encode(opj_j2k_t *j2k, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
void j2k_dump_image(FILE *fd, opj_image_t * img);
void j2k_dump_cp(FILE *fd, opj_image_t * img, opj_cp_t * cp);
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/*@}*/ /*@}*/

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, Herve Drolon, FreeImage Team * Copyright (c) 2005, Herv<EFBFBD> Drolon, FreeImage Team
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -24,18 +24,18 @@
* POSSIBILITY OF SUCH DAMAGE. * POSSIBILITY OF SUCH DAMAGE.
*/ */
#ifdef _WIN32 #ifdef WIN32
#include <windows.h> #include <windows.h>
#else #else
#include <sys/time.h> #include <sys/time.h>
#include <sys/resource.h> #include <sys/resource.h>
#include <sys/times.h> #include <sys/times.h>
#endif /* _WIN32 */ #endif /* WIN32 */
#include "opj_includes.h" #include "opj_includes.h"
double opj_clock(void) { double opj_clock(void) {
#ifdef _WIN32 #ifdef WIN32
/* _WIN32: use QueryPerformance (very accurate) */ /* WIN32: use QueryPerformance (very accurate) */
LARGE_INTEGER freq , t ; LARGE_INTEGER freq , t ;
/* freq is the clock speed of the CPU */ /* freq is the clock speed of the CPU */
QueryPerformanceFrequency(&freq) ; QueryPerformanceFrequency(&freq) ;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, Herve Drolon, FreeImage Team * Copyright (c) 2005, Herv<EFBFBD> Drolon, FreeImage Team
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without

File diff suppressed because it is too large Load Diff

View File

@@ -46,64 +46,11 @@
#define JP2_COLR 0x636f6c72 /**< Colour specification box */ #define JP2_COLR 0x636f6c72 /**< Colour specification box */
#define JP2_JP2C 0x6a703263 /**< Contiguous codestream box */ #define JP2_JP2C 0x6a703263 /**< Contiguous codestream box */
#define JP2_URL 0x75726c20 /**< URL box */ #define JP2_URL 0x75726c20 /**< URL box */
#define JP2_DTBL 0x6474626c /**< Data Reference box */ #define JP2_DBTL 0x6474626c /**< ??? */
#define JP2_BPCC 0x62706363 /**< Bits per component box */ #define JP2_BPCC 0x62706363 /**< Bits per component box */
#define JP2_JP2 0x6a703220 /**< File type fields */ #define JP2_JP2 0x6a703220 /**< File type fields */
#define JP2_PCLR 0x70636c72 /**< Palette box */
#define JP2_CMAP 0x636d6170 /**< Component Mapping box */
#define JP2_CDEF 0x63646566 /**< Channel Definition box */
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/**
Channel description: channel index, type, assocation
*/
typedef struct opj_jp2_cdef_info
{
unsigned short cn, typ, asoc;
} opj_jp2_cdef_info_t;
/**
Channel descriptions and number of descriptions
*/
typedef struct opj_jp2_cdef
{
opj_jp2_cdef_info_t *info;
unsigned short n;
} opj_jp2_cdef_t;
/**
Component mappings: channel index, mapping type, palette index
*/
typedef struct opj_jp2_cmap_comp
{
unsigned short cmp;
unsigned char mtyp, pcol;
} opj_jp2_cmap_comp_t;
/**
Palette data: table entries, palette columns
*/
typedef struct opj_jp2_pclr
{
unsigned int *entries;
unsigned char *channel_sign;
unsigned char *channel_size;
opj_jp2_cmap_comp_t *cmap;
unsigned short nr_entries, nr_channels;
} opj_jp2_pclr_t;
/**
Collector for ICC profile, palette, component mapping, channel description
*/
typedef struct opj_jp2_color
{
unsigned char *icc_profile_buf;
int icc_profile_len;
opj_jp2_cdef_t *jp2_cdef;
opj_jp2_pclr_t *jp2_pclr;
unsigned char jp2_has_colr;
} opj_jp2_color_t;
/** /**
JP2 component JP2 component
@@ -140,8 +87,6 @@ typedef struct opj_jp2 {
opj_jp2_comps_t *comps; opj_jp2_comps_t *comps;
unsigned int j2k_codestream_offset; unsigned int j2k_codestream_offset;
unsigned int j2k_codestream_length; unsigned int j2k_codestream_length;
opj_bool jpip_on;
opj_bool ignore_pclr_cmap_cdef;
} opj_jp2_t; } opj_jp2_t;
/** /**
@@ -166,10 +111,9 @@ void jp2_write_jp2h(opj_jp2_t *jp2, opj_cio_t *cio);
Read the JP2H box - JP2 Header box (used in MJ2) Read the JP2H box - JP2 Header box (used in MJ2)
@param jp2 JP2 handle @param jp2 JP2 handle
@param cio Input buffer stream @param cio Input buffer stream
@param ext Collector for profile, cdef and pclr data
@return Returns true if successful, returns false otherwise @return Returns true if successful, returns false otherwise
*/ */
opj_bool jp2_read_jp2h(opj_jp2_t *jp2, opj_cio_t *cio, opj_jp2_color_t *color); bool jp2_read_jp2h(opj_jp2_t *jp2, opj_cio_t *cio);
/** /**
Creates a JP2 decompression structure Creates a JP2 decompression structure
@param cinfo Codec context info @param cinfo Codec context info
@@ -195,7 +139,7 @@ Decode an image from a JPEG-2000 file stream
@param cstr_info Codestream information structure if required, NULL otherwise @param cstr_info Codestream information structure if required, NULL otherwise
@return Returns a decoded image if successful, returns NULL otherwise @return Returns a decoded image if successful, returns NULL otherwise
*/ */
opj_image_t* opj_jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio, opj_codestream_info_t *cstr_info); opj_image_t* jp2_decode(opj_jp2_t *jp2, opj_cio_t *cio, opj_codestream_info_t *cstr_info);
/** /**
Creates a JP2 compression structure Creates a JP2 compression structure
@param cinfo Codec context info @param cinfo Codec context info
@@ -223,8 +167,7 @@ Encode an image into a JPEG-2000 file stream
@param cstr_info Codestream information structure if required, NULL otherwise @param cstr_info Codestream information structure if required, NULL otherwise
@return Returns true if successful, returns false otherwise @return Returns true if successful, returns false otherwise
*/ */
opj_bool opj_jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info); bool jp2_encode(opj_jp2_t *jp2, opj_cio_t *cio, opj_image_t *image, opj_codestream_info_t *cstr_info);
/* ----------------------------------------------------------------------- */ /* ----------------------------------------------------------------------- */
/*@}*/ /*@}*/

Some files were not shown because too many files have changed in this diff Show More