Compare commits
9 Commits
curlthread
...
V2Baking
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e19372adf | ||
|
|
6381e4d9a4 | ||
|
|
d9f674218f | ||
|
|
693e3a0555 | ||
|
|
8376e890b2 | ||
|
|
33827bf8b0 | ||
|
|
06349951d2 | ||
|
|
4d68dc7c57 | ||
|
|
722e7d09ff |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,5 +1,4 @@
|
||||
/installed.xml
|
||||
/indra/llcommon/llversionviewer.h
|
||||
/indra/build-*
|
||||
/indra/tools/vstool/obj/
|
||||
*.aps
|
||||
@@ -12,13 +11,11 @@
|
||||
/indra/viewer-*
|
||||
/indra/newview/vivox-runtime/
|
||||
/libraries/
|
||||
/lib/
|
||||
*.pyc
|
||||
*.orig
|
||||
*.rej
|
||||
*.bak
|
||||
*~
|
||||
*.DS_Store
|
||||
/LICENSES/
|
||||
/edited-files.txt
|
||||
qtcreator-build/
|
||||
|
||||
23
LICENSES/boost.txt
Normal file
23
LICENSES/boost.txt
Normal 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
550
LICENSES/dbusglib.txt
Normal 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
19
LICENSES/elfio.txt
Normal 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
23
LICENSES/fontconfig.txt
Normal 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
29
LICENSES/libxml.txt
Normal 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
484
LICENSES/openal.txt
Normal 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!
|
||||
|
||||
5
LICENSES/qt-4.5-linden-changes.txt
Normal file
5
LICENSES/qt-4.5-linden-changes.txt
Normal 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/
|
||||
@@ -378,7 +378,14 @@
|
||||
<boolean>true</boolean>
|
||||
</map>
|
||||
|
||||
|
||||
<key>ParcelMediaURLFilter</key>
|
||||
<map>
|
||||
<key>flavor</key>
|
||||
<string>llsd</string>
|
||||
<key>trusted-sender</key>
|
||||
<boolean>false</boolean>
|
||||
</map>
|
||||
|
||||
<key>ParcelNavigateMedia</key>
|
||||
<map>
|
||||
<key>flavor</key>
|
||||
@@ -565,14 +572,6 @@
|
||||
<boolean>false</boolean>
|
||||
</map>
|
||||
|
||||
<key>ObjectPhysicsProperties</key>
|
||||
<map>
|
||||
<key>flavor</key>
|
||||
<string>llsd</string>
|
||||
<key>trusted-sender</key>
|
||||
<boolean>true</boolean>
|
||||
</map>
|
||||
|
||||
<!-- Server to client -->
|
||||
<key>DisplayNameUpdate</key>
|
||||
<map>
|
||||
@@ -671,19 +670,19 @@
|
||||
<key>EstateChangeInfo</key>
|
||||
<boolean>true</boolean>
|
||||
|
||||
<key>FetchInventoryDescendents2</key>
|
||||
<key>FetchInventoryDescendents</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>WebFetchInventoryDescendents</key>
|
||||
<boolean>false</boolean>
|
||||
|
||||
<key>FetchInventory2</key>
|
||||
<key>FetchInventory</key>
|
||||
<boolean>true</boolean>
|
||||
|
||||
<key>FetchLibDescendents2</key>
|
||||
<key>FetchLibDescendents</key>
|
||||
<boolean>true</boolean>
|
||||
|
||||
<key>FetchLib2</key>
|
||||
<key>FetchLib</key>
|
||||
<boolean>true</boolean>
|
||||
</map>
|
||||
|
||||
|
||||
@@ -26,15 +26,15 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||
include(Variables)
|
||||
|
||||
# Load versions now. Install locations need them.
|
||||
include(BuildVersion)
|
||||
include(Versions)
|
||||
|
||||
include(UnixInstall)
|
||||
|
||||
set (DISABLE_FATAL_WARNINGS TRUE)
|
||||
set (GCC_DISABLE_FATAL_WARNINGS TRUE)
|
||||
|
||||
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release CACHE STRING
|
||||
"Build type. One of: Debug Release RelWithDebInfo" FORCE)
|
||||
set(CMAKE_BUILD_TYPE ReleaseSSE2 CACHE STRING
|
||||
"Build type. One of: Debug Release ReleaseSSE2 RelWithDebInfo" FORCE)
|
||||
endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
|
||||
|
||||
# Create a 'prepare' target in which to perform setup actions. This
|
||||
@@ -77,7 +77,6 @@ if (VIEWER)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llcrashlogger)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llplugin)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llui)
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}llxuixml)
|
||||
|
||||
# viewer plugins directory
|
||||
add_subdirectory(${LIBS_OPEN_PREFIX}plugins)
|
||||
|
||||
@@ -12,20 +12,22 @@ set(CMAKE_CXX_FLAGS_RELEASE
|
||||
"-DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 -D_SECURE_SCL=0 -DLL_SEND_CRASH_REPORTS=1 -DNDEBUG")
|
||||
set(CMAKE_C_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
|
||||
"-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.
|
||||
|
||||
set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING
|
||||
set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;ReleaseSSE2;Debug" CACHE STRING
|
||||
"Supported build types." FORCE)
|
||||
|
||||
# Platform-specific compilation flags.
|
||||
|
||||
if (WINDOWS)
|
||||
# Remove default /Zm1000 flag that cmake inserts
|
||||
string (REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
|
||||
|
||||
# Don't build DLLs.
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
|
||||
@@ -35,17 +37,23 @@ if (WINDOWS)
|
||||
"${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /arch:SSE2"
|
||||
CACHE STRING "C++ compiler release-with-debug options" FORCE)
|
||||
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)
|
||||
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)
|
||||
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)
|
||||
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LARGEADDRESSAWARE")
|
||||
|
||||
set(CMAKE_CXX_STANDARD_LIBRARIES "")
|
||||
set(CMAKE_C_STANDARD_LIBRARIES "")
|
||||
|
||||
|
||||
add_definitions(
|
||||
/DLL_WINDOWS=1
|
||||
/DUNICODE
|
||||
@@ -59,43 +67,42 @@ if (WINDOWS)
|
||||
/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)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE
|
||||
"${CMAKE_CXX_FLAGS_RELEASE} -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
|
||||
CACHE STRING "C++ compiler release options" FORCE)
|
||||
set(CMAKE_C_FLAGS_RELEASE
|
||||
"${CMAKE_CXX_FLAGS_RELEASE} -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0"
|
||||
CACHE STRING "C compiler release options" FORCE)
|
||||
set(CMAKE_CXX_FLAGS_RELEASESSE2
|
||||
"${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(
|
||||
/Zc:wchar_t-
|
||||
)
|
||||
endif (MSVC80 OR MSVC90 OR MSVC10)
|
||||
|
||||
# Are we using the crummy Visual Studio KDU build workaround?
|
||||
if (NOT DISABLE_FATAL_WARNINGS)
|
||||
if (NOT VS_DISABLE_FATAL_WARNINGS)
|
||||
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
|
||||
# when we require them instead of reimplementing the test each time.
|
||||
|
||||
if (MSVC71)
|
||||
set(MSVC_DIR 7.1)
|
||||
set(MSVC_SUFFIX 71)
|
||||
elseif (MSVC80)
|
||||
set(MSVC_DIR 8.0)
|
||||
set(MSVC_SUFFIX 80)
|
||||
elseif (MSVC90)
|
||||
set(MSVC_DIR 9.0)
|
||||
set(MSVC_SUFFIX 90)
|
||||
elseif (MSVC10)
|
||||
set(MSVC_DIR 10.0)
|
||||
set(MSVC_SUFFIX 100)
|
||||
endif (MSVC71)
|
||||
set(MSVC_DIR 7.1)
|
||||
set(MSVC_SUFFIX 71)
|
||||
elseif (MSVC80)
|
||||
set(MSVC_DIR 8.0)
|
||||
set(MSVC_SUFFIX 80)
|
||||
elseif (MSVC90)
|
||||
set(MSVC_DIR 9.0)
|
||||
set(MSVC_SUFFIX 90)
|
||||
elseif (MSVC10)
|
||||
set(MSVC_DIR 10.0)
|
||||
set(MSVC_SUFFIX 100)
|
||||
endif (MSVC71)
|
||||
|
||||
if (MSVC10)
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
|
||||
@@ -106,208 +113,138 @@ if (WINDOWS)
|
||||
|
||||
endif (WINDOWS)
|
||||
|
||||
set (GCC_EXTRA_OPTIMIZATIONS "-ffast-math")
|
||||
set (GCC_EXTRA_OPTIMIZATIONS "-ffast-math -frounding-math")
|
||||
|
||||
if (LINUX)
|
||||
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(
|
||||
-DLL_LINUX=1
|
||||
-DAPPID=secondlife
|
||||
-D_REENTRANT
|
||||
-fexceptions
|
||||
-fno-math-errno
|
||||
-fno-strict-aliasing
|
||||
-fsigned-char
|
||||
-fvisibility=hidden
|
||||
-g
|
||||
-pthread
|
||||
)
|
||||
|
||||
# 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)
|
||||
|
||||
if(${CMAKE_C_COMPILER} MATCHES "gcc*")
|
||||
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)
|
||||
|
||||
# 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")
|
||||
|
||||
add_definitions(-DAPPID=secondlife)
|
||||
add_definitions(-fvisibility=hidden)
|
||||
# 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)
|
||||
if (NOT STANDALONE)
|
||||
# this stops us requiring a really recent glibc at runtime
|
||||
add_definitions(-fno-stack-protector)
|
||||
endif (NOT STANDALONE)
|
||||
if (${ARCH} STREQUAL "x86_64")
|
||||
add_definitions(-DLINUX64=1 -pipe)
|
||||
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")
|
||||
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")
|
||||
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")
|
||||
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")
|
||||
else (${ARCH} STREQUAL "x86_64")
|
||||
if (NOT STANDALONE)
|
||||
# this stops us requiring a really recent glibc at runtime
|
||||
add_definitions(-fno-stack-protector)
|
||||
set(MARCH_FLAG " -march=pentium4")
|
||||
endif (NOT STANDALONE)
|
||||
if (${ARCH} STREQUAL "x86_64")
|
||||
add_definitions(-DLINUX64=1 -pipe)
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fomit-frame-pointer -mmmx -msse -mfpmath=sse -msse2 -ffast-math -ftree-vectorize -fweb -fexpensive-optimizations -frename-registers")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fomit-frame-pointer -mmmx -msse -mfpmath=sse -msse2 -ffast-math -ftree-vectorize -fweb -fexpensive-optimizations -frename-registers")
|
||||
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")
|
||||
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")
|
||||
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)
|
||||
set(CMAKE_CXX_FLAGS_RELEASESSE2 "${CMAKE_CXX_FLAGS_RELEASESSE2}${MARCH_FLAG} -mfpmath=sse -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_C_FLAGS_RELEASESSE2 "${CMAKE_C_FLAGS_RELEASESSE2}${MARCH_FLAG} -mfpmath=sse -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}${MARCH_FLAG} -mfpmath=sse -msse2 ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
endif (${ARCH} STREQUAL "x86_64")
|
||||
|
||||
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 " -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_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG} -msse2")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_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_C_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 ${CMAKE_C_FLAGS_RELWITHDEBINFO}")
|
||||
endif (LINUX)
|
||||
|
||||
|
||||
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_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
|
||||
if(${CMAKE_C_COMPILER} MATCHES "gcc*")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_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 to have both CXX_FLAGS and C_FLAGS covered.
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -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_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3 -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}")
|
||||
elseif(${CMAKE_C_COMPILER} MATCHES "clang*")
|
||||
# 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()
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_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 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_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -03 -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_RELEASE "${CMAKE_C_FLAGS_RELEASE} -03 -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}")
|
||||
set(CMAKE_C_FLAGS_RELEASESSE2 "${CMAKE_C_FLAGS_RELEASESSE2} -03 -msse2 -mtune=generic -mfpmath=sse ${GCC_EXTRA_OPTIMIZATIONS}")
|
||||
endif (DARWIN)
|
||||
|
||||
|
||||
if (LINUX OR DARWIN)
|
||||
if(${CMAKE_C_COMPILER} MATCHES "gcc*")
|
||||
set(UNIX_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
|
||||
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Woverloaded-virtual")
|
||||
elseif(${CMAKE_C_COMPILER} MATCHES "clang*")
|
||||
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 ")
|
||||
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}")
|
||||
elseif(${CMAKE_C_COMPILER} MATCHES "icc")
|
||||
set(UNIX_WARNINGS "-wd327 -wd597 -wd858")
|
||||
set(UNIX_CXX_WARNINGS "${UNIX_WARNINGS}")
|
||||
endif()
|
||||
|
||||
if (NOT DISABLE_FATAL_WARNINGS)
|
||||
set(UNIX_WARNINGS "${UNIX_WARNINGS} -Werror")
|
||||
endif (NOT DISABLE_FATAL_WARNINGS)
|
||||
set(GCC_WARNINGS "-Wall -Wno-sign-compare -Wno-trigraphs")
|
||||
|
||||
if (NOT GCC_DISABLE_FATAL_WARNINGS)
|
||||
set(GCC_WARNINGS "${GCC_WARNINGS} -Werror")
|
||||
endif (NOT GCC_DISABLE_FATAL_WARNINGS)
|
||||
|
||||
set(GCC_CXX_WARNINGS "${GCC_WARNINGS} -Wno-reorder -Wno-non-virtual-dtor -Woverloaded-virtual")
|
||||
|
||||
set(CMAKE_C_FLAGS "${GCC_WARNINGS} ${CMAKE_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${GCC_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")
|
||||
|
||||
set(CMAKE_C_FLAGS "${UNIX_WARNINGS} ${CMAKE_C_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${UNIX_CXX_WARNINGS} ${CMAKE_CXX_FLAGS}")
|
||||
if (WORD_SIZE EQUAL 32)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
|
||||
@@ -333,25 +270,20 @@ else (STANDALONE)
|
||||
endif (STANDALONE)
|
||||
|
||||
if(1 EQUAL 1)
|
||||
add_definitions(-DOPENSIM_RULES=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 "")
|
||||
add_definitions(-DOPENSIM_RULES=1)
|
||||
add_definitions(-DMESH_ENABLED=1)
|
||||
endif(1 EQUAL 1)
|
||||
|
||||
SET( CMAKE_EXE_LINKER_FLAGS_RELEASE
|
||||
SET( CMAKE_EXE_LINKER_FLAGS_RELEASESSE2
|
||||
"${CMAKE_EXE_LINKER_FLAGS_RELEASE}" CACHE STRING
|
||||
"Flags used for linking binaries under build."
|
||||
"Flags used for linking binaries under SSE2 build."
|
||||
FORCE )
|
||||
SET( CMAKE_SHARED_LINKER_FLAGS_RELEASE
|
||||
SET( CMAKE_SHARED_LINKER_FLAGS_RELEASESSE2
|
||||
"${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 )
|
||||
MARK_AS_ADVANCED(
|
||||
CMAKE_CXX_FLAGS_RELEASE
|
||||
CMAKE_C_FLAGS_RELEASE
|
||||
CMAKE_EXE_LINKER_FLAGS_RELEASE
|
||||
CMAKE_SHARED_LINKER_FLAGS_RELEASE
|
||||
)
|
||||
CMAKE_CXX_FLAGS_RELEASESSE2
|
||||
CMAKE_C_FLAGS_RELEASESSE2
|
||||
CMAKE_EXE_LINKER_FLAGS_RELEASESSE2
|
||||
CMAKE_SHARED_LINKER_FLAGS_RELEASESSE2 )
|
||||
|
||||
@@ -29,12 +29,12 @@ else (STANDALONE)
|
||||
)
|
||||
elseif (DARWIN)
|
||||
set(APR_LIBRARIES
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.0.dylib
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.0.dylib
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libapr-1.0.3.7.dylib
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libapr-1.0.3.7.dylib
|
||||
)
|
||||
set(APRUTIL_LIBRARIES
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.dylib
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.dylib
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libaprutil-1.0.3.8.dylib
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libaprutil-1.0.3.8.dylib
|
||||
)
|
||||
set(APRICONV_LIBRARIES iconv)
|
||||
else (WINDOWS)
|
||||
|
||||
@@ -9,7 +9,7 @@ if (STANDALONE)
|
||||
pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
|
||||
else (STANDALONE)
|
||||
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(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include(Prebuilt)
|
||||
# -*- cmake -*-
|
||||
|
||||
set(DB_FIND_QUIETLY ON)
|
||||
set(DB_FIND_REQUIRED ON)
|
||||
@@ -8,10 +8,9 @@ if (STANDALONE)
|
||||
else (STANDALONE)
|
||||
if (LINUX)
|
||||
# Need to add dependency pthread explicitely to support ld.gold.
|
||||
use_prebuilt_binary(db)
|
||||
set(DB_LIBRARIES db-5.1 pthread)
|
||||
set(DB_LIBRARIES db-4.2 pthread)
|
||||
else (LINUX)
|
||||
set(DB_LIBRARIES db-4.2)
|
||||
endif (LINUX)
|
||||
set(DB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
||||
set(DB_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -10,10 +10,10 @@ if (STANDALONE)
|
||||
set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
|
||||
set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
|
||||
set(BOOST_REGEX_LIBRARY boost_regex-mt)
|
||||
set(BOOST_SYSTEM_LIBRARY boost_system-mt)
|
||||
set(BOOST_SYSTEM_LIBRARY boost_system-mt)
|
||||
else (STANDALONE)
|
||||
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)
|
||||
set(BOOST_VERSION 1_45)
|
||||
@@ -40,10 +40,10 @@ else (STANDALONE)
|
||||
debug libboost_regex-vc${MSVC_SUFFIX}-${BOOST_DEBUG_SUFFIX}-${BOOST_VERSION})
|
||||
|
||||
elseif (DARWIN)
|
||||
set(BOOST_FILESYSTEM_LIBRARY boost_filesystem)
|
||||
set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options)
|
||||
set(BOOST_REGEX_LIBRARY boost_regex)
|
||||
set(BOOST_SYSTEM_LIBRARY boost_system)
|
||||
set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
|
||||
set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
|
||||
set(BOOST_REGEX_LIBRARY boost_regex-mt)
|
||||
set(BOOST_SYSTEM_LIBRARY boost_system-mt)
|
||||
elseif (LINUX)
|
||||
set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt)
|
||||
set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt)
|
||||
|
||||
@@ -1,45 +1,23 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
# Read version components from the header file.
|
||||
file(STRINGS ${LIBS_OPEN_DIR}/llcommon/llversionviewer.h.in lines
|
||||
REGEX " LL_VERSION_")
|
||||
foreach(line ${lines})
|
||||
string(REGEX REPLACE ".*LL_VERSION_([A-Z]+).*" "\\1" comp "${line}")
|
||||
string(REGEX REPLACE ".* = ([0-9]+);.*" "\\1" value "${line}")
|
||||
set(v${comp} "${value}")
|
||||
endforeach(line)
|
||||
function (build_version _target)
|
||||
# Read version components from the header file.
|
||||
file(STRINGS ${LIBS_OPEN_DIR}/llcommon/llversion${_target}.h lines
|
||||
REGEX " LL_VERSION_")
|
||||
foreach(line ${lines})
|
||||
string(REGEX REPLACE ".*LL_VERSION_([A-Z]+).*" "\\1" comp "${line}")
|
||||
string(REGEX REPLACE ".* = ([0-9]+);.*" "\\1" value "${line}")
|
||||
set(v${comp} "${value}")
|
||||
endforeach(line)
|
||||
|
||||
execute_process(
|
||||
COMMAND git rev-list HEAD
|
||||
OUTPUT_VARIABLE GIT_REV_LIST_STR
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
# Compose the version.
|
||||
set(${_target}_VERSION "${vMAJOR}.${vMINOR}.${vPATCH}.${vBUILD}")
|
||||
if (${_target}_VERSION MATCHES "^[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+$")
|
||||
message(STATUS "Version of ${_target} is ${${_target}_VERSION}")
|
||||
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)
|
||||
string(REPLACE "\n" ";" GIT_REV_LIST ${GIT_REV_LIST_STR})
|
||||
else()
|
||||
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)
|
||||
# Report version to caller.
|
||||
set(${_target}_VERSION "${${_target}_VERSION}" PARENT_SCOPE)
|
||||
endfunction (build_version)
|
||||
|
||||
@@ -10,7 +10,6 @@ if (STANDALONE)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(ares)
|
||||
if (WINDOWS)
|
||||
add_definitions("-DCARES_STATICLIB")
|
||||
set(CARES_LIBRARIES areslib)
|
||||
elseif (DARWIN)
|
||||
set(CARES_LIBRARIES
|
||||
|
||||
@@ -29,16 +29,17 @@ set(cmake_SOURCE_FILES
|
||||
FindELFIO.cmake
|
||||
FindGooglePerfTools.cmake
|
||||
FindHunSpell.cmake
|
||||
FindMono.cmake
|
||||
FindMT.cmake
|
||||
FindMySQL.cmake
|
||||
FindNDOF.cmake
|
||||
FindOpenJPEG.cmake
|
||||
FindXmlRpcEpi.cmake
|
||||
FMOD.cmake
|
||||
FMODEX.cmake
|
||||
FMOD.cmake
|
||||
FreeType.cmake
|
||||
GStreamer010Plugin.cmake
|
||||
GooglePerfTools.cmake
|
||||
Hunspell.cmake
|
||||
HUNSPELL.cmake
|
||||
JPEG.cmake
|
||||
LLAddBuildTest.cmake
|
||||
LLAudio.cmake
|
||||
@@ -62,6 +63,8 @@ set(cmake_SOURCE_FILES
|
||||
LLXML.cmake
|
||||
LScript.cmake
|
||||
Linking.cmake
|
||||
MonoEmbed.cmake
|
||||
MySQL.cmake
|
||||
NDOF.cmake
|
||||
OPENAL.cmake
|
||||
OpenGL.cmake
|
||||
@@ -76,10 +79,15 @@ set(cmake_SOURCE_FILES
|
||||
UI.cmake
|
||||
UnixInstall.cmake
|
||||
Variables.cmake
|
||||
Versions.cmake
|
||||
XmlRpcEpi.cmake
|
||||
ZLIB.cmake
|
||||
)
|
||||
|
||||
if(FMODEX)
|
||||
list(APPEND cmake_SOURCE_FILES FMODEX.cmake)
|
||||
endif(FMODEX)
|
||||
|
||||
source_group("Shared Rules" FILES ${cmake_SOURCE_FILES})
|
||||
|
||||
set(master_SOURCE_FILES
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
set(CURL_FIND_QUIETLY OFF)
|
||||
set(CURL_FIND_QUIETLY ON)
|
||||
set(CURL_FIND_REQUIRED ON)
|
||||
|
||||
if (STANDALONE)
|
||||
@@ -14,9 +14,6 @@ else (STANDALONE)
|
||||
optimized libcurl)
|
||||
else (WINDOWS)
|
||||
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)
|
||||
set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -29,8 +29,6 @@ set(debug_files
|
||||
libapr-1.dll
|
||||
libaprutil-1.dll
|
||||
libapriconv-1.dll
|
||||
libeay32.dll
|
||||
ssleay32.dll
|
||||
)
|
||||
|
||||
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_files
|
||||
libeay32.dll
|
||||
libglib-2.0-0.dll
|
||||
libgmodule-2.0-0.dll
|
||||
libgobject-2.0-0.dll
|
||||
libgthread-2.0-0.dll
|
||||
qtcored4.dll
|
||||
qtguid4.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_files
|
||||
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
|
||||
qtgui4.dll
|
||||
qtnetwork4.dll
|
||||
@@ -105,6 +112,14 @@ copy_if_different(
|
||||
)
|
||||
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(
|
||||
${plugintest_release_src_dir}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/RelWithDebInfo"
|
||||
@@ -131,6 +146,14 @@ copy_if_different(
|
||||
)
|
||||
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(
|
||||
${plugintest_release_src_dir}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/../test_apps/llplugintest/RelWithDebInfo/imageformats"
|
||||
@@ -147,6 +170,14 @@ copy_if_different(
|
||||
)
|
||||
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(
|
||||
${plugintest_release_src_dir}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llplugin/imageformats"
|
||||
@@ -193,6 +224,14 @@ copy_if_different(
|
||||
)
|
||||
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(
|
||||
${plugins_release_src_dir}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo/llplugin"
|
||||
@@ -208,44 +247,46 @@ set(release_files
|
||||
libapr-1.dll
|
||||
libaprutil-1.dll
|
||||
libapriconv-1.dll
|
||||
libeay32.dll
|
||||
ssleay32.dll
|
||||
)
|
||||
|
||||
if(FMODEX)
|
||||
find_path(FMODEX_BINARY_DIR fmodex.dll
|
||||
find_path(FMODEX_BINARY_DIR fmodex.dll
|
||||
${release_src_dir}
|
||||
${FMODEX_SDK_DIR}/api
|
||||
${FMODEX_SDK_DIR}
|
||||
)
|
||||
|
||||
if(FMODEX_BINARY_DIR)
|
||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets fmodex.dll)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets fmodex.dll)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
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)
|
||||
if(FMODEX_BINARY_DIR)
|
||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets fmodex.dll)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2" out_targets fmodex.dll)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
copy_if_different("${FMODEX_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets fmodex.dll)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
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)
|
||||
|
||||
if(FMOD)
|
||||
find_path(FMOD_BINARY_DIR fmod.dll
|
||||
find_path(FMOD_BINARY_DIR fmod.dll
|
||||
${release_src_dir}
|
||||
${FMOD_SDK_DIR}/api
|
||||
${FMOD_SDK_DIR}
|
||||
)
|
||||
|
||||
if(FMOD_BINARY_DIR)
|
||||
copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets fmod.dll)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets fmod.dll)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Debug" out_targets fmod.dll)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
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)
|
||||
if(FMOD_BINARY_DIR)
|
||||
copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Release" out_targets fmod.dll)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/ReleaseSSE2" out_targets fmod.dll)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo" out_targets fmod.dll)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
copy_if_different("${FMOD_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/Debug" out_targets fmod.dll)
|
||||
set(all_targets ${all_targets} ${out_targets})
|
||||
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)
|
||||
|
||||
copy_if_different(
|
||||
@@ -264,6 +305,22 @@ copy_if_different(
|
||||
)
|
||||
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(
|
||||
${release_src_dir}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
|
||||
@@ -314,6 +371,15 @@ else(EXISTS ${internal_llkdu_path})
|
||||
COMMENT "Copying llkdu.dll ${CMAKE_CURRENT_BINARY_DIR}/Release"
|
||||
)
|
||||
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")
|
||||
ADD_CUSTOM_COMMAND(
|
||||
@@ -389,6 +455,14 @@ if (MSVC80)
|
||||
)
|
||||
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(
|
||||
${release_msvc8_redist_path}
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/RelWithDebInfo"
|
||||
@@ -409,6 +483,19 @@ if (MSVC80)
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Release/Microsoft.VC80.CRT.manifest
|
||||
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)
|
||||
add_custom_command(
|
||||
@@ -430,6 +517,7 @@ add_custom_target(copy_win_libs ALL
|
||||
DEPENDS
|
||||
${all_targets}
|
||||
${release_appconfig_file}
|
||||
${releasesse2_appconfig_file}
|
||||
${relwithdebinfo_appconfig_file}
|
||||
${debug_appconfig_file}
|
||||
)
|
||||
|
||||
@@ -7,14 +7,15 @@ if (STANDALONE)
|
||||
pkg_check_modules(DBUSGLIB REQUIRED dbus-glib-1)
|
||||
|
||||
elseif (LINUX)
|
||||
use_prebuilt_binary(glib) # dbusglib needs glib
|
||||
use_prebuilt_binary(dbusglib)
|
||||
set(DBUSGLIB_FOUND ON FORCE BOOL)
|
||||
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
|
||||
dbus-glib-1
|
||||
gobject-2.0
|
||||
glib-2.0
|
||||
)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
if (VIEWER AND WINDOWS)
|
||||
find_path(DIRECTX_INCLUDE_DIR dxdiag.h
|
||||
"$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 (August 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
|
||||
"$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 (August 2008)/Lib/x86"
|
||||
"$ENV{PROGRAMFILES}/Microsoft DirectX SDK (June 2008)/Lib/x86"
|
||||
|
||||
@@ -8,7 +8,7 @@ if (STANDALONE)
|
||||
elseif (LINUX)
|
||||
use_prebuilt_binary(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")
|
||||
endif (STANDALONE)
|
||||
|
||||
|
||||
@@ -13,5 +13,5 @@ else (STANDALONE)
|
||||
else (WINDOWS)
|
||||
set(EXPAT_LIBRARIES expat)
|
||||
endif (WINDOWS)
|
||||
set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
||||
set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -7,13 +7,26 @@ if(INSTALL_PROPRIETARY)
|
||||
use_prebuilt_binary(fmod)
|
||||
endif(INSTALL_PROPRIETARY)
|
||||
|
||||
find_library(FMOD_LIBRARY
|
||||
find_library(FMOD_LIBRARY_RELEASE
|
||||
NAMES fmod fmodvc fmod-3.75
|
||||
PATHS
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}
|
||||
${ARCH_PREBUILT_DIRS_RELEASE}
|
||||
)
|
||||
|
||||
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)
|
||||
set(FMOD_SDK_DIR CACHE PATH "Path to the FMOD SDK.")
|
||||
if (FMOD_SDK_DIR)
|
||||
|
||||
@@ -7,18 +7,31 @@ if(INSTALL_PROPRIETARY)
|
||||
use_prebuilt_binary(fmodex)
|
||||
endif(INSTALL_PROPRIETARY)
|
||||
|
||||
find_library(FMODEX_LIBRARY
|
||||
find_library(FMODEX_LIBRARY_RELEASE
|
||||
NAMES fmodex fmodex_vc fmodexL_vc
|
||||
PATHS
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}
|
||||
${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)
|
||||
set(FMODEX_SDK_DIR CACHE PATH "Path to the FMOD Ex SDK.")
|
||||
if (FMODEX_SDK_DIR)
|
||||
find_library(FMODEX_LIBRARY
|
||||
fmodex_vc fmodexL_vc fmodex fmodexL fmodex64 fmodexL64
|
||||
fmodex fmodex_vc fmodexL_vc
|
||||
PATHS
|
||||
${FMODEX_SDK_DIR}/api/lib
|
||||
${FMODEX_SDK_DIR}/api
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
# also defined, but not for general use are
|
||||
# JSONCPP_LIBRARY, where to find the jsoncpp library.
|
||||
|
||||
FIND_PATH(JSONCPP_INCLUDE_DIR json/json.h
|
||||
FIND_PATH(JSONCPP_INCLUDE_DIR jsoncpp/json.h
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
)
|
||||
@@ -24,8 +24,8 @@ EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
|
||||
# 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)
|
||||
# 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
|
||||
NAMES ${JSONCPP_NAMES}
|
||||
|
||||
@@ -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})
|
||||
|
||||
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)
|
||||
get_filename_component(LLQTWEBKIT_LIBRARY_DIRS ${LLQTWEBKIT_LIBRARY} PATH)
|
||||
endif (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND)
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
#Find the windows manifest tool.
|
||||
if (MSVC80)
|
||||
FIND_PROGRAM(HAVE_MANIFEST_TOOL NAMES mt
|
||||
PATHS
|
||||
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/VC/bin"
|
||||
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin"
|
||||
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/SDK/v2.0/Bin")
|
||||
IF(HAVE_MANIFEST_TOOL)
|
||||
MESSAGE(STATUS "Found Mainfest Tool. Embedding custom manifests.")
|
||||
ELSE(HAVE_MANIFEST_TOOL)
|
||||
MESSAGE(FATAL_ERROR "Manifest tool, mt.exe, can't be found.")
|
||||
ENDIF(HAVE_MANIFEST_TOOL)
|
||||
|
||||
STRING(REPLACE "/MANIFEST " "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
|
||||
${CMAKE_EXE_LINKER_FLAGS})
|
||||
|
||||
endif (MSVC80)
|
||||
#Find the windows manifest tool.
|
||||
if (MSVC80)
|
||||
FIND_PROGRAM(HAVE_MANIFEST_TOOL NAMES mt
|
||||
PATHS
|
||||
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/VC/bin"
|
||||
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/Common7/Tools/Bin"
|
||||
"$ENV{PROGRAMFILES}/Microsoft Visual Studio 8/SDK/v2.0/Bin")
|
||||
IF(HAVE_MANIFEST_TOOL)
|
||||
MESSAGE(STATUS "Found Mainfest Tool. Embedding custom manifests.")
|
||||
ELSE(HAVE_MANIFEST_TOOL)
|
||||
MESSAGE(FATAL_ERROR "Manifest tool, mt.exe, can't be found.")
|
||||
ENDIF(HAVE_MANIFEST_TOOL)
|
||||
|
||||
STRING(REPLACE "/MANIFEST " "/MANIFEST:NO" CMAKE_EXE_LINKER_FLAGS
|
||||
${CMAKE_EXE_LINKER_FLAGS})
|
||||
|
||||
endif (MSVC80)
|
||||
|
||||
68
indra/cmake/FindMono.cmake
Normal file
68
indra/cmake/FindMono.cmake
Normal 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)
|
||||
48
indra/cmake/FindMySQL.cmake
Normal file
48
indra/cmake/FindMySQL.cmake
Normal 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
|
||||
)
|
||||
@@ -11,7 +11,7 @@ else (STANDALONE)
|
||||
set(FREETYPE_INCLUDE_DIRS
|
||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
||||
else (LINUX)
|
||||
set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
||||
set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
endif (LINUX)
|
||||
|
||||
set(FREETYPE_LIBRARIES freetype)
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
# -*- cmake -*-
|
||||
include(Prebuilt)
|
||||
|
||||
if(WORD_SIZE EQUAL 64)
|
||||
set(DISABLE_TCMALLOC TRUE)
|
||||
endif(WORD_SIZE EQUAL 64)
|
||||
|
||||
if (STANDALONE)
|
||||
include(FindGooglePerfTools)
|
||||
else (STANDALONE)
|
||||
if (LINUX OR WINDOWS AND NOT WORD_SIZE EQUAL 64)
|
||||
use_prebuilt_binary(gperftools)
|
||||
endif (LINUX OR WINDOWS AND NOT WORD_SIZE EQUAL 64)
|
||||
if (LINUX OR WINDOWS)
|
||||
use_prebuilt_binary(google)
|
||||
endif (LINUX OR WINDOWS)
|
||||
if (WINDOWS)
|
||||
set(TCMALLOC_LIBRARIES libtcmalloc_minimal.lib)
|
||||
set(TCMALLOC_LINKER_FLAGS "/INCLUDE:\"__tcmalloc\"")
|
||||
|
||||
@@ -6,10 +6,10 @@ if (STANDALONE)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(hunspell)
|
||||
|
||||
set(HUNSPELL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/hunspell)
|
||||
set(HUNSPELL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/hunspell)
|
||||
|
||||
if (LINUX OR DARWIN)
|
||||
set(HUNSPELL_LIBRARY hunspell-1.3)
|
||||
set(HUNSPELL_LIBRARY hunspell-1.2)
|
||||
else (LINUX OR DARWIN)
|
||||
set(HUNSPELL_LIBRARY libhunspell)
|
||||
endif (LINUX OR DARWIN)
|
||||
@@ -13,11 +13,11 @@ else (STANDALONE)
|
||||
set(JPEG_LIBRARIES jpeg)
|
||||
elseif (DARWIN)
|
||||
set(JPEG_LIBRARIES
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/libjpeg.a
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/libjpeg.a
|
||||
optimized ${ARCH_PREBUILT_DIRS_RELEASE}/liblljpeg.a
|
||||
debug ${ARCH_PREBUILT_DIRS_DEBUG}/liblljpeg.a
|
||||
)
|
||||
elseif (WINDOWS)
|
||||
set(JPEG_LIBRARIES jpeglib)
|
||||
endif (LINUX)
|
||||
set(JPEG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
||||
set(JPEG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -14,9 +14,9 @@ else (STANDALONE)
|
||||
debug json_vc${MSVC_SUFFIX}d
|
||||
optimized json_vc${MSVC_SUFFIX})
|
||||
elseif (DARWIN)
|
||||
set(JSONCPP_LIBRARIES json_linux-gcc-4.0.1_libmt)
|
||||
set(JSONCPP_LIBRARIES json_mac-universal-gcc_libmt)
|
||||
elseif (LINUX)
|
||||
set(JSONCPP_LIBRARIES jsoncpp)
|
||||
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)
|
||||
|
||||
@@ -14,7 +14,6 @@ endif (DARWIN)
|
||||
set(LLCOMMON_INCLUDE_DIRS
|
||||
${LIBS_OPEN_DIR}/cwdebug
|
||||
${LIBS_OPEN_DIR}/llcommon
|
||||
${APRUTIL_INCLUDE_DIR}
|
||||
${APR_INCLUDE_DIR}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
@@ -8,7 +8,7 @@ set(LLPLUGIN_INCLUDE_DIRS
|
||||
if (LINUX)
|
||||
# In order to support using ld.gold on linux, we need to explicitely
|
||||
# specify all libraries that llplugin uses.
|
||||
set(LLPLUGIN_LIBRARIES llplugin pthread)
|
||||
set(LLPLUGIN_LIBRARIES llplugin pthread)
|
||||
else (LINUX)
|
||||
set(LLPLUGIN_LIBRARIES llplugin)
|
||||
set(LLPLUGIN_LIBRARIES llplugin)
|
||||
endif (LINUX)
|
||||
|
||||
@@ -13,17 +13,15 @@ if (STANDALONE)
|
||||
SDL_LIBRARY
|
||||
)
|
||||
else (STANDALONE)
|
||||
if (LINUX)
|
||||
if (NOT DARWIN)
|
||||
use_prebuilt_binary(mesa)
|
||||
endif (NOT DARWIN)
|
||||
if (LINUX AND VIEWER)
|
||||
use_prebuilt_binary(SDL)
|
||||
set (SDL_FOUND TRUE)
|
||||
set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR})
|
||||
if(WORD_SIZE EQUAL 64)
|
||||
set (SDL_LIBRARY SDL)
|
||||
else(WORD_SIZE EQUAL 64)
|
||||
set (SDL_LIBRARY SDL directfb fusion direct)
|
||||
endif(WORD_SIZE EQUAL 64)
|
||||
endif (LINUX)
|
||||
set (SDL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/i686-linux)
|
||||
set (SDL_LIBRARY SDL)
|
||||
endif (LINUX AND VIEWER)
|
||||
endif (STANDALONE)
|
||||
|
||||
if (SDL_FOUND)
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
# -*- cmake -*-
|
||||
|
||||
set(LLXUIXML_INCLUDE_DIRS
|
||||
${LIBS_OPEN_DIR}/llxuixml
|
||||
)
|
||||
|
||||
set(LLXUIXML_LIBRARIES llxuixml)
|
||||
@@ -6,13 +6,17 @@ if (NOT STANDALONE)
|
||||
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)
|
||||
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_DEBUG ${ARCH_PREBUILT_DIRS})
|
||||
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_DEBUG ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/lib/debug)
|
||||
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 ${ARCH_PREBUILT_DIRS_RELEASE})
|
||||
endif (WINDOWS)
|
||||
endif (NOT STANDALONE)
|
||||
|
||||
|
||||
48
indra/cmake/MonoDeps.cmake
Normal file
48
indra/cmake/MonoDeps.cmake
Normal 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)
|
||||
57
indra/cmake/MonoEmbed.cmake
Normal file
57
indra/cmake/MonoEmbed.cmake
Normal 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
26
indra/cmake/MySQL.cmake
Normal 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)
|
||||
@@ -15,7 +15,7 @@ else (STANDALONE)
|
||||
set(NDOF_LIBRARY ndofdev)
|
||||
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)
|
||||
endif (STANDALONE)
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ if (OPENAL)
|
||||
openal
|
||||
alut
|
||||
)
|
||||
set(OPENAL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
||||
endif (OPENAL)
|
||||
|
||||
if (OPENAL)
|
||||
|
||||
@@ -6,5 +6,5 @@ if (NOT (STANDALONE OR DARWIN))
|
||||
# possible glh_linear should have its own .cmake file instead
|
||||
#use_prebuilt_binary(glh_linear)
|
||||
# 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 ()
|
||||
|
||||
@@ -16,6 +16,8 @@ else (STANDALONE)
|
||||
set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include)
|
||||
endif (STANDALONE)
|
||||
|
||||
if (LINUX OR DARWIN)
|
||||
if (LINUX)
|
||||
set(CRYPTO_LIBRARIES crypto)
|
||||
endif (LINUX OR DARWIN)
|
||||
elseif (DARWIN)
|
||||
set(CRYPTO_LIBRARIES llcrypto)
|
||||
endif (LINUX)
|
||||
|
||||
@@ -10,10 +10,8 @@ else (STANDALONE)
|
||||
use_prebuilt_binary(libpng)
|
||||
if (WINDOWS)
|
||||
set(PNG_LIBRARIES libpng15)
|
||||
elseif(DARWIN)
|
||||
set(PNG_LIBRARIES png15)
|
||||
else(LINUX)
|
||||
set(PNG_LIBRARIES png15)
|
||||
endif()
|
||||
set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/libpng15)
|
||||
else (WINDOWS)
|
||||
set(PNG_LIBRARIES png12)
|
||||
endif (WINDOWS)
|
||||
set(PNG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
|
||||
endif (STANDALONE)
|
||||
|
||||
2
indra/cmake/PulseAudio.cmake
Normal file → Executable file
2
indra/cmake/PulseAudio.cmake
Normal file → Executable file
@@ -13,7 +13,7 @@ if (PULSEAUDIO)
|
||||
use_prebuilt_binary(pulseaudio)
|
||||
set(PULSEAUDIO_FOUND ON FORCE BOOL)
|
||||
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
|
||||
# the viewer probes for the system's copy at runtime.
|
||||
|
||||
@@ -19,6 +19,7 @@ if (WINDOWS)
|
||||
[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.3\\InstallPath]
|
||||
|
||||
)
|
||||
elseif (EXISTS /etc/debian_version)
|
||||
# On Debian and Ubuntu, avoid Python 2.4 if possible.
|
||||
|
||||
@@ -31,12 +31,13 @@ if (STANDALONE)
|
||||
add_definitions(${${pkg}_CFLAGS_OTHERS})
|
||||
endforeach(pkg)
|
||||
else (STANDALONE)
|
||||
if (LINUX)
|
||||
if (NOT DARWIN)
|
||||
use_prebuilt_binary(glib) # gtk-etc needs glib
|
||||
use_prebuilt_binary(gtk-atk-pango-glib)
|
||||
endif (NOT DARWIN)
|
||||
if (LINUX)
|
||||
set(UI_LIBRARIES
|
||||
atk-1.0
|
||||
X11
|
||||
gdk-x11-2.0
|
||||
gdk_pixbuf-2.0
|
||||
Xinerama
|
||||
@@ -58,6 +59,7 @@ else (STANDALONE)
|
||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include
|
||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/cairo
|
||||
${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/pixman-1
|
||||
${LIBS_PREBUILT_DIR}/include
|
||||
)
|
||||
foreach(include ${${LL_ARCH}_INCLUDES})
|
||||
include_directories(${LIBS_PREBUILT_DIR}/${LL_ARCH_DIR}/include/${include})
|
||||
|
||||
@@ -76,36 +76,37 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(DARWIN 1)
|
||||
|
||||
if(${CMAKE_GENERATOR} MATCHES Xcode)
|
||||
#SDK Compiler and Deployment targets for XCode
|
||||
if (${XCODE_VERSION} VERSION_LESS 4.0.0)
|
||||
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
|
||||
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()
|
||||
#SDK Compiler and Deployment targets for XCode
|
||||
if (${XCODE_VERSION} VERSION_LESS 4.0.0)
|
||||
set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.5.sdk)
|
||||
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(${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_ARCHITECTURES i386)
|
||||
set(ARCH i386)
|
||||
set(WORD_SIZE 32)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
|
||||
|
||||
## But if you want to compile for mixed 32/64 bit, try these:
|
||||
# set(CMAKE_OSX_ARCHITECTURES i386;x86_64)
|
||||
# set(ARCH universal)
|
||||
# set(WORD_SIZE 64)
|
||||
# NOTE: To attempt an i386/PPC Universal build, add this on the configure line:
|
||||
# -DCMAKE_OSX_ARCHITECTURES:STRING='i386;ppc'
|
||||
# Build only for i386 by default, system default on MacOSX 10.6 is x86_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_DIR universal-darwin)
|
||||
set(WORD_SIZE 32)
|
||||
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
||||
|
||||
|
||||
9
indra/cmake/Versions.cmake
Normal file
9
indra/cmake/Versions.cmake
Normal file
@@ -0,0 +1,9 @@
|
||||
include(BuildVersion)
|
||||
|
||||
if(VIEWER)
|
||||
build_version(viewer)
|
||||
endif(VIEWER)
|
||||
|
||||
if(SERVER)
|
||||
build_version(server)
|
||||
endif(SERVER)
|
||||
@@ -67,16 +67,11 @@ elseif (LINUX)
|
||||
QtNetwork
|
||||
QtGui
|
||||
QtCore
|
||||
crypto
|
||||
ssl
|
||||
# qgif
|
||||
# qjpeg
|
||||
jscore
|
||||
jpeg
|
||||
fontconfig
|
||||
X11
|
||||
Xrender
|
||||
Xext
|
||||
GL
|
||||
)
|
||||
endif (STANDALONE)
|
||||
|
||||
@@ -9,5 +9,5 @@ if (STANDALONE)
|
||||
else (STANDALONE)
|
||||
use_prebuilt_binary(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)
|
||||
|
||||
@@ -17,6 +17,6 @@ else (STANDALONE)
|
||||
set(ZLIB_LIBRARIES z)
|
||||
endif (WINDOWS)
|
||||
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 (STANDALONE)
|
||||
|
||||
@@ -171,10 +171,7 @@ void stop_recording_backtraces(void)
|
||||
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 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 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 Curl.
|
||||
channel_ct curlio DDCN("CURLIO"); //!< This debug channel is used to print debug output of libcurl.
|
||||
channel_ct statemachine DDCN("STATEMACHINE"); //!< This debug channel is used class AIStateMachine.
|
||||
|
||||
} // namespace dc
|
||||
} // namespace DEBUGCHANNELS
|
||||
|
||||
@@ -117,9 +117,6 @@ extern CWD_API channel_ct gtk;
|
||||
extern CWD_API channel_ct sdl;
|
||||
extern CWD_API channel_ct backtrace;
|
||||
extern CWD_API channel_ct statemachine;
|
||||
extern CWD_API channel_ct caps;
|
||||
extern CWD_API channel_ct curl;
|
||||
extern CWD_API channel_ct curlio;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ def quote(opts):
|
||||
class PlatformSetup(object):
|
||||
generator = None
|
||||
build_types = {}
|
||||
for t in ('Debug', 'Release', 'RelWithDebInfo'):
|
||||
for t in ('Debug', 'Release', 'ReleaseSSE2', 'RelWithDebInfo'):
|
||||
build_types[t.lower()] = t
|
||||
|
||||
build_type = build_types['relwithdebinfo']
|
||||
@@ -764,7 +764,7 @@ Options:
|
||||
--unattended build unattended, do not invoke any tools requiring
|
||||
a human response
|
||||
--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)
|
||||
-N | --no-distcc disable use of distcc
|
||||
-G | --generator=NAME generator name
|
||||
@@ -775,8 +775,9 @@ Options:
|
||||
-p | --project=NAME set the root project name. (Doesn't effect makefiles)
|
||||
|
||||
Commands:
|
||||
build configure and build default target
|
||||
clean delete all build directories, does not affect sources
|
||||
build configure and build default target
|
||||
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)
|
||||
printbuilddirs print the build directory that will be used
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ ARGUMENTS=[
|
||||
On Linux this would try to use Linux_i686Manifest.""",
|
||||
default=""),
|
||||
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="Release"),
|
||||
dict(name='branding_id', description="""Identifier for the branding set to
|
||||
@@ -168,10 +168,7 @@ ARGUMENTS=[
|
||||
dict(name='version',
|
||||
description="""This specifies the version of Second Life that is
|
||||
being packaged up.""",
|
||||
default=get_default_version),
|
||||
dict(name='extra_libraries',
|
||||
description="""List of extra libraries to include in package""",
|
||||
default=None)
|
||||
default=get_default_version)
|
||||
]
|
||||
|
||||
def usage(srctree=""):
|
||||
|
||||
@@ -570,7 +570,7 @@ static void v4dwt_interleave_h(v4dwt_t* restrict w, float* restrict a, int x, in
|
||||
int count = w->sn;
|
||||
int i, k;
|
||||
for(k = 0; k < 2; ++k){
|
||||
if (count + 3 * x < size && ((long) a & 0x0f) == 0 && ((long) 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 */
|
||||
for(i = 0; i < count; ++i){
|
||||
int j = i;
|
||||
|
||||
@@ -1,163 +1,163 @@
|
||||
/*
|
||||
* Copyright (c) 2005, Herv<72> Drolon, FreeImage Team
|
||||
* Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>
|
||||
* 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.
|
||||
*/
|
||||
#ifndef __OPJ_MALLOC_H
|
||||
#define __OPJ_MALLOC_H
|
||||
/**
|
||||
@file opj_malloc.h
|
||||
@brief Internal functions
|
||||
|
||||
The functions in opj_malloc.h are internal utilities used for memory management.
|
||||
*/
|
||||
|
||||
/** @defgroup MISC MISC - Miscellaneous internal functions */
|
||||
/*@{*/
|
||||
|
||||
/** @name Exported functions */
|
||||
/*@{*/
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
Allocate an uninitialized memory block
|
||||
@param size Bytes to allocate
|
||||
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void * OPJ_CALLCONV opj_malloc(size_t size);
|
||||
#else
|
||||
#define opj_malloc(size) malloc(size)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Allocate a memory block with elements initialized to 0
|
||||
@param num Blocks to allocate
|
||||
@param size Bytes per block to allocate
|
||||
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void * OPJ_CALLCONV opj_calloc(size_t _NumOfElements, size_t _SizeOfElements);
|
||||
#else
|
||||
#define opj_calloc(num, size) calloc(num, size)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Allocate memory aligned to a 16 byte boundry
|
||||
@param size Bytes to allocate
|
||||
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
|
||||
*/
|
||||
/* FIXME: These should be set with cmake tests, but we're currently not requiring use of cmake */
|
||||
#ifdef WIN32
|
||||
/* Someone should tell the mingw people that their malloc.h ought to provide _mm_malloc() */
|
||||
#ifdef __GNUC__
|
||||
#include <mm_malloc.h>
|
||||
#define HAVE_MM_MALLOC
|
||||
#else /* MSVC, Intel C++ */
|
||||
#include <malloc.h>
|
||||
#ifdef _mm_malloc
|
||||
#define HAVE_MM_MALLOC
|
||||
#endif
|
||||
#endif
|
||||
#else /* Not WIN32 */
|
||||
#if defined(__sun)
|
||||
#define HAVE_MEMALIGN
|
||||
/* Linux x86_64 and OSX always align allocations to 16 bytes */
|
||||
#elif !defined(__amd64__) && !defined(__APPLE__)
|
||||
#define HAVE_MEMALIGN
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define opj_aligned_malloc(size) malloc(size)
|
||||
#define opj_aligned_free(m) free(m)
|
||||
|
||||
#ifdef HAVE_MM_MALLOC
|
||||
#undef opj_aligned_malloc
|
||||
#define opj_aligned_malloc(size) _mm_malloc(size, 16)
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) _mm_free(m)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MEMALIGN
|
||||
extern void* memalign(size_t, size_t);
|
||||
#undef opj_aligned_malloc
|
||||
#define opj_aligned_malloc(size) memalign(16, (size))
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) free(m)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_POSIX_MEMALIGN
|
||||
#undef opj_aligned_malloc
|
||||
extern int posix_memalign(void**, size_t, size_t);
|
||||
|
||||
static INLINE void* __attribute__ ((malloc)) opj_aligned_malloc(size_t size){
|
||||
void* mem = NULL;
|
||||
posix_memalign(&mem, 16, size);
|
||||
return mem;
|
||||
}
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) free(m)
|
||||
#endif
|
||||
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
#undef opj_aligned_malloc
|
||||
#define opj_aligned_malloc(size) opj_malloc(size)
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) opj_free(m)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Reallocate memory blocks.
|
||||
@param memblock Pointer to previously allocated memory block
|
||||
@param size New size in bytes
|
||||
@return Returns a void pointer to the reallocated (and possibly moved) memory block
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void * OPJ_CALLCONV opj_realloc(void * _Memory, size_t NewSize);
|
||||
#else
|
||||
#define opj_realloc(m, s) realloc(m, s)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Deallocates or frees a memory block.
|
||||
@param memblock Previously allocated memory block to be freed
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void OPJ_CALLCONV opj_free(void * _Memory);
|
||||
#else
|
||||
#define opj_free(m) free(m)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC poison malloc calloc realloc free
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
/*@}*/
|
||||
|
||||
/*@}*/
|
||||
|
||||
#endif /* __OPJ_MALLOC_H */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, Herv<72> Drolon, FreeImage Team
|
||||
* Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>
|
||||
* 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.
|
||||
*/
|
||||
#ifndef __OPJ_MALLOC_H
|
||||
#define __OPJ_MALLOC_H
|
||||
/**
|
||||
@file opj_malloc.h
|
||||
@brief Internal functions
|
||||
|
||||
The functions in opj_malloc.h are internal utilities used for memory management.
|
||||
*/
|
||||
|
||||
/** @defgroup MISC MISC - Miscellaneous internal functions */
|
||||
/*@{*/
|
||||
|
||||
/** @name Exported functions */
|
||||
/*@{*/
|
||||
/* ----------------------------------------------------------------------- */
|
||||
|
||||
/**
|
||||
Allocate an uninitialized memory block
|
||||
@param size Bytes to allocate
|
||||
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void * OPJ_CALLCONV opj_malloc(size_t size);
|
||||
#else
|
||||
#define opj_malloc(size) malloc(size)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Allocate a memory block with elements initialized to 0
|
||||
@param num Blocks to allocate
|
||||
@param size Bytes per block to allocate
|
||||
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void * OPJ_CALLCONV opj_calloc(size_t _NumOfElements, size_t _SizeOfElements);
|
||||
#else
|
||||
#define opj_calloc(num, size) calloc(num, size)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Allocate memory aligned to a 16 byte boundry
|
||||
@param size Bytes to allocate
|
||||
@return Returns a void pointer to the allocated space, or NULL if there is insufficient memory available
|
||||
*/
|
||||
/* FIXME: These should be set with cmake tests, but we're currently not requiring use of cmake */
|
||||
#ifdef WIN32
|
||||
/* Someone should tell the mingw people that their malloc.h ought to provide _mm_malloc() */
|
||||
#ifdef __GNUC__
|
||||
#include <mm_malloc.h>
|
||||
#define HAVE_MM_MALLOC
|
||||
#else /* MSVC, Intel C++ */
|
||||
#include <malloc.h>
|
||||
#ifdef _mm_malloc
|
||||
#define HAVE_MM_MALLOC
|
||||
#endif
|
||||
#endif
|
||||
#else /* Not WIN32 */
|
||||
#if defined(__sun)
|
||||
#define HAVE_MEMALIGN
|
||||
/* Linux x86_64 and OSX always align allocations to 16 bytes */
|
||||
#elif !defined(__amd64__) && !defined(__APPLE__)
|
||||
#define HAVE_MEMALIGN
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define opj_aligned_malloc(size) malloc(size)
|
||||
#define opj_aligned_free(m) free(m)
|
||||
|
||||
#ifdef HAVE_MM_MALLOC
|
||||
#undef opj_aligned_malloc
|
||||
#define opj_aligned_malloc(size) _mm_malloc(size, 16)
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) _mm_free(m)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MEMALIGN
|
||||
extern void* memalign(size_t, size_t);
|
||||
#undef opj_aligned_malloc
|
||||
#define opj_aligned_malloc(size) memalign(16, (size))
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) free(m)
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_POSIX_MEMALIGN
|
||||
#undef opj_aligned_malloc
|
||||
extern int posix_memalign(void**, size_t, size_t);
|
||||
|
||||
static INLINE void* __attribute__ ((malloc)) opj_aligned_malloc(size_t size){
|
||||
void* mem = NULL;
|
||||
posix_memalign(&mem, 16, size);
|
||||
return mem;
|
||||
}
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) free(m)
|
||||
#endif
|
||||
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
#undef opj_aligned_malloc
|
||||
#define opj_aligned_malloc(size) opj_malloc(size)
|
||||
#undef opj_aligned_free
|
||||
#define opj_aligned_free(m) opj_free(m)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Reallocate memory blocks.
|
||||
@param memblock Pointer to previously allocated memory block
|
||||
@param size New size in bytes
|
||||
@return Returns a void pointer to the reallocated (and possibly moved) memory block
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void * OPJ_CALLCONV opj_realloc(void * _Memory, size_t NewSize);
|
||||
#else
|
||||
#define opj_realloc(m, s) realloc(m, s)
|
||||
#endif
|
||||
|
||||
/**
|
||||
Deallocates or frees a memory block.
|
||||
@param memblock Previously allocated memory block to be freed
|
||||
*/
|
||||
#ifdef ALLOC_PERF_OPT
|
||||
void OPJ_CALLCONV opj_free(void * _Memory);
|
||||
#else
|
||||
#define opj_free(m) free(m)
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#pragma GCC poison malloc calloc realloc free
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------------- */
|
||||
/*@}*/
|
||||
|
||||
/*@}*/
|
||||
|
||||
#endif /* __OPJ_MALLOC_H */
|
||||
|
||||
|
||||
@@ -5,25 +5,27 @@ project(llaudio)
|
||||
include(00-Common)
|
||||
include(Audio)
|
||||
include(LLAudio)
|
||||
if (FMODEX)
|
||||
include(FMODEX)
|
||||
set(FMOD OFF)
|
||||
endif (FMODEX)
|
||||
if (NOT FMODEX)
|
||||
include(FMOD)
|
||||
endif (NOT FMODEX)
|
||||
if(FMODEX)
|
||||
include(FMODEX)
|
||||
if(FMODEX)
|
||||
set(FMOD OFF)
|
||||
endif(FMODEX)
|
||||
endif(FMODEX)
|
||||
if(NOT FMODEX)
|
||||
include(FMOD)
|
||||
endif(NOT FMODEX)
|
||||
include(OPENAL)
|
||||
include(LLCommon)
|
||||
include(LLMath)
|
||||
include(LLMessage)
|
||||
include(LLVFS)
|
||||
|
||||
if (FMODEX)
|
||||
include_directories(${FMODEX_INCLUDE_DIR})
|
||||
if(FMODEX)
|
||||
include_directories(${FMODEX_INCLUDE_DIR})
|
||||
endif(FMODEX)
|
||||
if(FMOD)
|
||||
include_directories(${FMOD_INCLUDE_DIR})
|
||||
endif (FMOD)
|
||||
include_directories(${FMOD_INCLUDE_DIR})
|
||||
endif(FMOD)
|
||||
|
||||
include_directories(
|
||||
${LLAUDIO_INCLUDE_DIRS}
|
||||
@@ -35,7 +37,7 @@ include_directories(
|
||||
${VORBISENC_INCLUDE_DIRS}
|
||||
${VORBISFILE_INCLUDE_DIRS}
|
||||
${VORBIS_INCLUDE_DIRS}
|
||||
${OPENAL_INCLUDE_DIRS}
|
||||
${OPENAL_LIB_INCLUDE_DIRS}
|
||||
${FREEAULT_LIB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
|
||||
@@ -168,13 +168,19 @@ long vfs_tell (void *datasource)
|
||||
return file->tell();
|
||||
}
|
||||
|
||||
LLVorbisDecodeState::LLVorbisDecodeState(const LLUUID &uuid, const std::string &out_filename) :
|
||||
mValid(FALSE), mDone(FALSE), mBytesRead(-1), mUUID(uuid),
|
||||
#if !defined(USE_WAV_VFILE)
|
||||
mOutFilename(out_filename), mFileHandle(LLLFSThread::nullHandle()),
|
||||
#endif
|
||||
mInFilep(NULL), mCurrentSection(0)
|
||||
LLVorbisDecodeState::LLVorbisDecodeState(const LLUUID &uuid, const std::string &out_filename)
|
||||
{
|
||||
mDone = FALSE;
|
||||
mValid = FALSE;
|
||||
mBytesRead = -1;
|
||||
mUUID = uuid;
|
||||
mInFilep = NULL;
|
||||
mCurrentSection = 0;
|
||||
#if !defined(USE_WAV_VFILE)
|
||||
mOutFilename = out_filename;
|
||||
mFileHandle = LLLFSThread::nullHandle();
|
||||
#endif
|
||||
// No default value for mVF, it's an ogg structure?
|
||||
}
|
||||
|
||||
LLVorbisDecodeState::~LLVorbisDecodeState()
|
||||
@@ -236,8 +242,8 @@ BOOL LLVorbisDecodeState::initDecode()
|
||||
llwarns << "No default bitstream found" << llendl;
|
||||
}
|
||||
// <edit>
|
||||
// This magic value is equivalent to 150MiB of data.
|
||||
// Prevents griefers from utilizing a huge xbox sound the size of god to instafry the viewer
|
||||
// This magic value is equivilent to 150MiB of data.
|
||||
// Prevents griffers from utilizin a huge xbox sound the size of god to instafry the viewer
|
||||
if(size_guess >= 157286400)
|
||||
{
|
||||
llwarns << "Bad sound caught by zmagic" << llendl;
|
||||
@@ -610,8 +616,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
||||
llwarns << mCurrentDecodep->getUUID() << " has invalid vorbis data, aborting decode" << llendl;
|
||||
mCurrentDecodep->flushBadFile();
|
||||
LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
|
||||
adp->setHasValidData(false);
|
||||
adp->setHasCompletedDecode(true);
|
||||
adp->setHasValidData(FALSE);
|
||||
mCurrentDecodep = NULL;
|
||||
done = TRUE;
|
||||
}
|
||||
@@ -626,16 +631,11 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
||||
if (mCurrentDecodep->finishDecode())
|
||||
{
|
||||
// We finished!
|
||||
LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
|
||||
if (!adp)
|
||||
if (mCurrentDecodep->isValid() && mCurrentDecodep->isDone())
|
||||
{
|
||||
llwarns << "Missing LLAudioData for decode of " << mCurrentDecodep->getUUID() << llendl;
|
||||
}
|
||||
else if (mCurrentDecodep->isValid() && mCurrentDecodep->isDone())
|
||||
{
|
||||
adp->setHasCompletedDecode(true);
|
||||
adp->setHasDecodedData(true);
|
||||
adp->setHasValidData(true);
|
||||
LLAudioData *adp = gAudiop->getAudioData(mCurrentDecodep->getUUID());
|
||||
adp->setHasDecodedData(TRUE);
|
||||
adp->setHasValidData(TRUE);
|
||||
|
||||
// At this point, we could see if anyone needs this sound immediately, but
|
||||
// I'm not sure that there's a reason to - we need to poll all of the playing
|
||||
@@ -644,8 +644,7 @@ void LLAudioDecodeMgr::Impl::processQueue(const F32 num_secs)
|
||||
}
|
||||
else
|
||||
{
|
||||
adp->setHasCompletedDecode(true);
|
||||
llinfos << "Vorbis decode failed for " << mCurrentDecodep->getUUID() << llendl;
|
||||
llinfos << "Vorbis decode failed!!!" << llendl;
|
||||
}
|
||||
mCurrentDecodep = NULL;
|
||||
}
|
||||
@@ -713,18 +712,15 @@ BOOL LLAudioDecodeMgr::addDecodeRequest(const LLUUID &uuid)
|
||||
if (gAudiop->hasDecodedFile(uuid))
|
||||
{
|
||||
// Already have a decoded version, don't need to decode it.
|
||||
//llinfos << "addDecodeRequest for " << uuid << " has decoded file already" << llendl;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND))
|
||||
{
|
||||
// Just put it on the decode queue.
|
||||
//llinfos << "addDecodeRequest for " << uuid << " has local asset file already" << llendl;
|
||||
mImpl->mDecodeQueue.push(uuid);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//llinfos << "addDecodeRequest for " << uuid << " no file available" << llendl;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1275,11 +1275,10 @@ void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::E
|
||||
// Need to mark data as bad to avoid constant rerequests.
|
||||
LLAudioData *adp = gAudiop->getAudioData(uuid);
|
||||
if (adp)
|
||||
{ // Make sure everything is cleared
|
||||
{
|
||||
adp->setHasValidData(false);
|
||||
adp->setHasLocalData(false);
|
||||
adp->setHasDecodedData(false);
|
||||
adp->setHasCompletedDecode(true);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1292,10 +1291,9 @@ void LLAudioEngine::assetCallback(LLVFS *vfs, const LLUUID &uuid, LLAssetType::E
|
||||
}
|
||||
else
|
||||
{
|
||||
// llinfos << "Got asset callback with good audio data for " << uuid << ", making decode request" << llendl;
|
||||
adp->setHasValidData(true);
|
||||
adp->setHasLocalData(true);
|
||||
gAudioDecodeMgrp->addDecodeRequest(uuid);
|
||||
adp->setHasLocalData(true);
|
||||
gAudioDecodeMgrp->addDecodeRequest(uuid);
|
||||
}
|
||||
}
|
||||
gAudiop->mCurrentTransfer = LLUUID::null;
|
||||
@@ -1323,7 +1321,6 @@ LLAudioSource::LLAudioSource(const LLUUID& id, const LLUUID& owner_id, const F32
|
||||
mSyncSlave(false),
|
||||
mQueueSounds(false),
|
||||
mPlayedOnce(false),
|
||||
mCorrupted(false),
|
||||
mType(type),
|
||||
// <edit>
|
||||
mSourceID(source_id),
|
||||
@@ -1375,27 +1372,16 @@ void LLAudioSource::setChannel(LLAudioChannel *channelp)
|
||||
|
||||
void LLAudioSource::update()
|
||||
{
|
||||
if(mCorrupted)
|
||||
{
|
||||
return ; //no need to update
|
||||
}
|
||||
|
||||
if (!getCurrentBuffer())
|
||||
{
|
||||
LLAudioData *adp = getCurrentData();
|
||||
if (adp)
|
||||
if (getCurrentData())
|
||||
{
|
||||
// Hack - try and load the sound. Will do this as a callback
|
||||
// on decode later.
|
||||
if (adp->load() && adp->getBuffer())
|
||||
if (getCurrentData()->load())
|
||||
{
|
||||
play(adp->getID());
|
||||
}
|
||||
else if (adp->hasCompletedDecode()) // Only mark corrupted after decode is done
|
||||
{
|
||||
llwarns << "Marking LLAudioSource corrupted for " << adp->getID() << llendl;
|
||||
mCorrupted = true ;
|
||||
}
|
||||
play(getCurrentData()->getID());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1516,11 +1502,6 @@ bool LLAudioSource::play(const LLUUID &audio_uuid)
|
||||
|
||||
bool LLAudioSource::isDone() const
|
||||
{
|
||||
if(mCorrupted)
|
||||
{
|
||||
return true ;
|
||||
}
|
||||
|
||||
const F32 MAX_AGE = 60.f;
|
||||
const F32 MAX_UNPLAYED_AGE = 15.f;
|
||||
const F32 MAX_MUTED_AGE = 11.f;
|
||||
@@ -1816,7 +1797,6 @@ LLAudioData::LLAudioData(const LLUUID &uuid) :
|
||||
mBufferp(NULL),
|
||||
mHasLocalData(false),
|
||||
mHasDecodedData(false),
|
||||
mHasCompletedDecode(false),
|
||||
mHasValidData(true)
|
||||
{
|
||||
if (uuid.isNull())
|
||||
@@ -1828,17 +1808,16 @@ LLAudioData::LLAudioData(const LLUUID &uuid) :
|
||||
if (gAudiop && gAudiop->hasDecodedFile(uuid))
|
||||
{
|
||||
// Already have a decoded version, don't need to decode it.
|
||||
setHasLocalData(true);
|
||||
setHasDecodedData(true);
|
||||
setHasCompletedDecode(true);
|
||||
mHasLocalData = true;
|
||||
mHasDecodedData = true;
|
||||
}
|
||||
else if (gAssetStorage && gAssetStorage->hasLocalAsset(uuid, LLAssetType::AT_SOUND))
|
||||
{
|
||||
setHasLocalData(true);
|
||||
mHasLocalData = true;
|
||||
}
|
||||
}
|
||||
|
||||
//return false when the audio file is corrupted.
|
||||
|
||||
bool LLAudioData::load()
|
||||
{
|
||||
// For now, just assume we're going to use one buffer per audiodata.
|
||||
@@ -1854,7 +1833,7 @@ bool LLAudioData::load()
|
||||
{
|
||||
// No free buffers, abort.
|
||||
llinfos << "Not able to allocate a new audio buffer, aborting." << llendl;
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string uuid_str;
|
||||
|
||||
@@ -239,15 +239,12 @@ protected:
|
||||
// A list of all audio sources that are known to the viewer at this time.
|
||||
// This is most likely a superset of the ones that we actually have audio
|
||||
// data for, or are playing back.
|
||||
public://Jay: IDGAF
|
||||
typedef std::map<LLUUID, LLAudioSource *> source_map;
|
||||
protected:
|
||||
typedef std::map<LLUUID, LLAudioData *> data_map;
|
||||
|
||||
public://Jay: IDGAF
|
||||
|
||||
source_map mAllSources;
|
||||
protected:
|
||||
data_map mAllData;
|
||||
|
||||
LLAudioChannel *mChannels[MAX_CHANNELS];
|
||||
|
||||
// Buffers needs to change into a different data structure, as the number of buffers
|
||||
@@ -354,9 +351,6 @@ public:
|
||||
protected:
|
||||
LLUUID mID; // The ID of the source is that of the object if it's attached to an object.
|
||||
LLUUID mOwnerID; // owner of the object playing the sound
|
||||
public:
|
||||
const LLUUID &getOwnerID() { return mOwnerID; }
|
||||
protected:
|
||||
F32 mPriority;
|
||||
F32 mGain;
|
||||
bool mSourceMuted;
|
||||
@@ -366,7 +360,6 @@ protected:
|
||||
bool mSyncSlave;
|
||||
bool mQueueSounds;
|
||||
bool mPlayedOnce;
|
||||
bool mCorrupted;
|
||||
S32 mType;
|
||||
LLVector3d mPositionGlobal;
|
||||
LLVector3 mVelocity;
|
||||
@@ -408,12 +401,10 @@ public:
|
||||
|
||||
bool hasLocalData() const { return mHasLocalData; }
|
||||
bool hasDecodedData() const { return mHasDecodedData; }
|
||||
bool hasCompletedDecode() const { return mHasCompletedDecode; }
|
||||
bool hasValidData() const { return mHasValidData; }
|
||||
|
||||
void setHasLocalData(const bool hld) { mHasLocalData = hld; }
|
||||
void setHasDecodedData(const bool hdd) { mHasDecodedData = hdd; }
|
||||
void setHasCompletedDecode(const bool hcd) { mHasCompletedDecode = hcd; }
|
||||
void setHasValidData(const bool hvd) { mHasValidData = hvd; }
|
||||
|
||||
friend class LLAudioEngine; // Severe laziness, bad.
|
||||
@@ -421,10 +412,9 @@ public:
|
||||
protected:
|
||||
LLUUID mID;
|
||||
LLAudioBuffer *mBufferp; // If this data is being used by the audio system, a pointer to the buffer will be set here.
|
||||
bool mHasLocalData; // Set true if the sound asset file is available locally
|
||||
bool mHasDecodedData; // Set true if the sound file has been decoded
|
||||
bool mHasCompletedDecode; // Set true when the sound is decoded
|
||||
bool mHasValidData; // Set false if decoding failed, meaning the sound asset is bad
|
||||
bool mHasLocalData;
|
||||
bool mHasDecodedData;
|
||||
bool mHasValidData;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -95,28 +95,6 @@ inline bool Check_FMOD_Error(FMOD_RESULT result, const char *string)
|
||||
return true;
|
||||
}
|
||||
|
||||
void* F_STDCALL decode_alloc(unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr)
|
||||
{
|
||||
if(type & FMOD_MEMORY_STREAM_DECODE)
|
||||
{
|
||||
llinfos << "Decode buffer size: " << size << llendl;
|
||||
}
|
||||
else if(type & FMOD_MEMORY_STREAM_FILE)
|
||||
{
|
||||
llinfos << "Strean buffer size: " << size << llendl;
|
||||
}
|
||||
return new char[size];
|
||||
}
|
||||
void* F_STDCALL decode_realloc(void *ptr, unsigned int size, FMOD_MEMORY_TYPE type, const char *sourcestr)
|
||||
{
|
||||
memset(ptr,0,size);
|
||||
return ptr;
|
||||
}
|
||||
void F_STDCALL decode_dealloc(void *ptr, FMOD_MEMORY_TYPE type, const char *sourcestr)
|
||||
{
|
||||
delete[] (char*)ptr;
|
||||
}
|
||||
|
||||
bool LLAudioEngine_FMODEX::init(const S32 num_channels, void* userdata)
|
||||
{
|
||||
|
||||
@@ -127,13 +105,13 @@ bool LLAudioEngine_FMODEX::init(const S32 num_channels, void* userdata)
|
||||
|
||||
U32 version;
|
||||
FMOD_RESULT result;
|
||||
int numdrivers;
|
||||
FMOD_SPEAKERMODE speakermode;
|
||||
FMOD_CAPS caps;
|
||||
char name[256];
|
||||
|
||||
LL_DEBUGS("AppInit") << "LLAudioEngine_FMODEX::init() initializing FMOD" << LL_ENDL;
|
||||
|
||||
result = FMOD::Memory_Initialize(NULL, 0, &decode_alloc, &decode_realloc, &decode_dealloc, FMOD_MEMORY_STREAM_DECODE | FMOD_MEMORY_STREAM_FILE);
|
||||
if(Check_FMOD_Error(result, "FMOD::Memory_Initialize"))
|
||||
return false;
|
||||
|
||||
result = FMOD::System_Create(&mSystem);
|
||||
if(Check_FMOD_Error(result, "FMOD::System_Create"))
|
||||
return false;
|
||||
@@ -146,15 +124,56 @@ bool LLAudioEngine_FMODEX::init(const S32 num_channels, void* userdata)
|
||||
|
||||
if (version < FMOD_VERSION)
|
||||
{
|
||||
LL_WARNS("AppInit") << "Error : You are using the wrong FMOD Ex version (" << version
|
||||
<< ")! You should be using FMOD Ex" << FMOD_VERSION << LL_ENDL;
|
||||
LL_WARNS("AppInit") << "Error : You are using the wrong FMOD version (" << version
|
||||
<< ")! You should be using FMOD " << FMOD_VERSION << LL_ENDL;
|
||||
}
|
||||
|
||||
result = mSystem->setSoftwareFormat(44100, FMOD_SOUND_FORMAT_PCM16, 0, 0, FMOD_DSP_RESAMPLER_LINEAR);
|
||||
Check_FMOD_Error(result,"FMOD::System::setSoftwareFormat");
|
||||
#if LL_WINDOWS
|
||||
//Is this block applicable to linux?
|
||||
{
|
||||
result = mSystem->getNumDrivers(&numdrivers);
|
||||
Check_FMOD_Error(result, "FMOD::System::getNumDrivers");
|
||||
if (numdrivers == 0)
|
||||
{
|
||||
result = mSystem->setOutput(FMOD_OUTPUTTYPE_NOSOUND);
|
||||
Check_FMOD_Error(result, "FMOD::System::setOutput");
|
||||
}
|
||||
else
|
||||
{
|
||||
result = mSystem->getDriverCaps(0, &caps, 0, &speakermode);
|
||||
Check_FMOD_Error(result,"FMOD::System::getDriverCaps");
|
||||
/*
|
||||
Set the user selected speaker mode.
|
||||
*/
|
||||
result = mSystem->setSpeakerMode(speakermode);
|
||||
Check_FMOD_Error(result, "FMOD::System::setSpeakerMode");
|
||||
if (caps & FMOD_CAPS_HARDWARE_EMULATED)
|
||||
{
|
||||
/*
|
||||
The user has the 'Acceleration' slider set to off! This is really bad
|
||||
for latency! You might want to warn the user about this.
|
||||
*/
|
||||
result = mSystem->setDSPBufferSize(1024, 10);
|
||||
Check_FMOD_Error(result, "FMOD::System::setDSPBufferSize");
|
||||
}
|
||||
result = mSystem->getDriverInfo(0, name, 256, 0);
|
||||
Check_FMOD_Error(result, "FMOD::System::getDriverInfo");
|
||||
|
||||
if (strstr(name, "SigmaTel"))
|
||||
{
|
||||
/*
|
||||
Sigmatel sound devices crackle for some reason if the format is PCM 16bit.
|
||||
PCM floating point output seems to solve it.
|
||||
*/
|
||||
result = mSystem->setSoftwareFormat(48000, FMOD_SOUND_FORMAT_PCMFLOAT, 0,0, FMOD_DSP_RESAMPLER_LINEAR);
|
||||
Check_FMOD_Error(result,"FMOD::System::setSoftwareFormat");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //LL_WINDOWS
|
||||
|
||||
// In this case, all sounds, PLUS wind and stream will be software.
|
||||
result = mSystem->setSoftwareChannels(num_channels + 2);
|
||||
result = mSystem->setSoftwareChannels(num_channels+2);
|
||||
Check_FMOD_Error(result,"FMOD::System::setSoftwareChannels");
|
||||
|
||||
U32 fmod_flags = FMOD_INIT_NORMAL;
|
||||
@@ -162,67 +181,73 @@ bool LLAudioEngine_FMODEX::init(const S32 num_channels, void* userdata)
|
||||
fmod_flags |= FMOD_INIT_ENABLE_PROFILE;
|
||||
|
||||
#if LL_LINUX
|
||||
// If we don't set an output method, Linux FMOD always
|
||||
// decides on OSS and fails otherwise. So we'll manually
|
||||
// try ESD, then OSS, then ALSA.
|
||||
// Why this order? See SL-13250, but in short, OSS emulated
|
||||
// on top of ALSA is ironically more reliable than raw ALSA.
|
||||
// Ack, and ESD has more reliable failure modes - but has worse
|
||||
// latency - than all of them, so wins for now.
|
||||
bool audio_ok = false;
|
||||
|
||||
if (!audio_ok)
|
||||
{
|
||||
if (NULL == getenv("LL_BAD_FMOD_PULSEAUDIO")) /*Flawfinder: ignore*/
|
||||
if (NULL == getenv("LL_BAD_FMODEX_ESD")) /*Flawfinder: ignore*/
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "Trying PulseAudio audio output..." << LL_ENDL;
|
||||
if(mSystem->setOutput(FMOD_OUTPUTTYPE_PULSEAUDIO) == FMOD_OK &&
|
||||
(result = mSystem->init(num_channels + 2, fmod_flags, 0)) == FMOD_OK)
|
||||
LL_DEBUGS("AppInit") << "Trying ESD audio output..." << LL_ENDL;
|
||||
if(mSystem->SetOutput(FMOD_OUTPUTTYPE_ESD) == FMOD_OK &&
|
||||
(result = mSystem->init(num_channels, fmod_flags, 0)) == FMOD_OK)
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "PulseAudio output initialized OKAY" << LL_ENDL;
|
||||
LL_DEBUGS("AppInit") << "ESD audio output initialized OKAY" << LL_ENDL;
|
||||
audio_ok = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Check_FMOD_Error(result, "PulseAudio audio output FAILED to initialize");
|
||||
Check_FMOD_Error(result, "ESD audio output FAILED to initialize");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "PulseAudio audio output SKIPPED" << LL_ENDL;
|
||||
LL_DEBUGS("AppInit") << "ESD audio output SKIPPED" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
if (!audio_ok)
|
||||
{
|
||||
if (NULL == getenv("LL_BAD_FMOD_ALSA")) /*Flawfinder: ignore*/
|
||||
if (NULL == getenv("LL_BAD_FMODEX_OSS")) /*Flawfinder: ignore*/
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "Trying ALSA audio output..." << LL_ENDL;
|
||||
if(mSystem->setOutput(FMOD_OUTPUTTYPE_ALSA) == FMOD_OK &&
|
||||
(result = mSystem->init(num_channels + 2, fmod_flags, 0)) == FMOD_OK)
|
||||
LL_DEBUGS("AppInit") << "Trying OSS audio output..." << LL_ENDL;
|
||||
if(mSystem->SetOutput(FMOD_OUTPUTTYPE_OSS) == FMOD_OK &&
|
||||
(result = mSystem->init(num_channels, fmod_flags, 0)) == FMOD_OK)
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "ALSA audio output initialized OKAY" << LL_ENDL;
|
||||
LL_DEBUGS("AppInit") << "OSS audio output initialized OKAY" << LL_ENDL;
|
||||
audio_ok = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Check_FMOD_Error(result, "ALSA audio output FAILED to initialize");
|
||||
Check_FMOD_Error(result, "OSS audio output FAILED to initialize" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "ALSA audio output SKIPPED" << LL_ENDL;
|
||||
LL_DEBUGS("AppInit") << "OSS audio output SKIPPED" << LL_ENDL;
|
||||
}
|
||||
}
|
||||
if (!audio_ok)
|
||||
{
|
||||
if (NULL == getenv("LL_BAD_FMOD_OSS")) /*Flawfinder: ignore*/
|
||||
if (NULL == getenv("LL_BAD_FMODEX_ALSA")) /*Flawfinder: ignore*/
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "Trying OSS audio output..." << LL_ENDL;
|
||||
if(mSystem->setOutput(FMOD_OUTPUTTYPE_OSS) == FMOD_OK &&
|
||||
(result = mSystem->init(num_channels + 2, fmod_flags, 0)) == FMOD_OK)
|
||||
LL_DEBUGS("AppInit") << "Trying ALSA audio output..." << LL_ENDL;
|
||||
if(mSystem->SetOutput(FMOD_OUTPUTTYPE_ALSA) &&
|
||||
(result = mSystem->init(num_channels, fmod_flags, 0)) == FMOD_OK)
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "OSS audio output initialized OKAY" << LL_ENDL;
|
||||
LL_DEBUGS("AppInit") << "ALSA audio output initialized OKAY" << LL_ENDL;
|
||||
audio_ok = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
Check_FMOD_Error(result, "OSS audio output FAILED to initialize");
|
||||
Check_FMOD_Error(result, "ALSA audio output FAILED to initialize");
|
||||
}
|
||||
}
|
||||
else
|
||||
} else
|
||||
{
|
||||
LL_DEBUGS("AppInit") << "OSS audio output SKIPPED" << LL_ENDL;
|
||||
}
|
||||
@@ -233,20 +258,25 @@ bool LLAudioEngine_FMODEX::init(const S32 num_channels, void* userdata)
|
||||
return false;
|
||||
}
|
||||
|
||||
// On Linux, FMOD causes a SIGPIPE for some netstream error
|
||||
// conditions (an FMOD bug); ignore SIGPIPE so it doesn't crash us.
|
||||
// NOW FIXED in FMOD 3.x since 2006-10-01.
|
||||
//signal(SIGPIPE, SIG_IGN);
|
||||
|
||||
// We're interested in logging which output method we
|
||||
// ended up with, for QA purposes.
|
||||
FMOD_OUTPUTTYPE output_type;
|
||||
mSystem->getOutput(&output_type);
|
||||
mSystem->getOutput(output_type);
|
||||
switch (output_type)
|
||||
{
|
||||
case FMOD_OUTPUTTYPE_NOSOUND:
|
||||
LL_INFOS("AppInit") << "Audio output: NoSound" << LL_ENDL; break;
|
||||
case FMOD_OUTPUTTYPE_PULSEAUDIO:
|
||||
LL_INFOS("AppInit") << "Audio output: PulseAudio" << LL_ENDL; break;
|
||||
case FMOD_OUTPUTTYPE_ALSA:
|
||||
LL_INFOS("AppInit") << "Audio output: ALSA" << LL_ENDL; break;
|
||||
case FMOD_OUTPUTTYPE_OSS:
|
||||
LL_INFOS("AppInit") << "Audio output: OSS" << LL_ENDL; break;
|
||||
case FSOUND_OUTPUT_NOSOUND:
|
||||
LL_DEBUGS("AppInit") << "Audio output: NoSound" << LL_ENDL; break;
|
||||
case FSOUND_OUTPUT_OSS:
|
||||
LL_DEBUGS("AppInit") << "Audio output: OSS" << LL_ENDL; break;
|
||||
case FSOUND_OUTPUT_ESD:
|
||||
LL_DEBUGS("AppInit") << "Audio output: ESD" << LL_ENDL; break;
|
||||
case FSOUND_OUTPUT_ALSA:
|
||||
LL_DEBUGS("AppInit") << "Audio output: ALSA" << LL_ENDL; break;
|
||||
default:
|
||||
LL_INFOS("AppInit") << "Audio output: Unknown!" << LL_ENDL; break;
|
||||
};
|
||||
@@ -265,9 +295,9 @@ bool LLAudioEngine_FMODEX::init(const S32 num_channels, void* userdata)
|
||||
/*
|
||||
... and re-init.
|
||||
*/
|
||||
result = mSystem->init( num_channels + 2, fmod_flags, 0);
|
||||
result = mSystem->init(100, FMOD_INIT_NORMAL, 0);
|
||||
}
|
||||
if(Check_FMOD_Error(result, "Error initializing FMOD Ex"))
|
||||
if(Check_FMOD_Error(result, "Error initializing FMOD"))
|
||||
return false;
|
||||
#endif
|
||||
|
||||
@@ -275,20 +305,7 @@ bool LLAudioEngine_FMODEX::init(const S32 num_channels, void* userdata)
|
||||
if (!getStreamingAudioImpl()) // no existing implementation added
|
||||
setStreamingAudioImpl(new LLStreamingAudio_FMODEX(mSystem));
|
||||
|
||||
LL_INFOS("AppInit") << "LLAudioEngine_FMODEX::init() FMOD Ex initialized correctly" << LL_ENDL;
|
||||
|
||||
int r_numbuffers, r_samplerate, r_channels, r_bits;
|
||||
unsigned int r_bufferlength;
|
||||
char r_name[256];
|
||||
mSystem->getDSPBufferSize(&r_bufferlength, &r_numbuffers);
|
||||
mSystem->getSoftwareFormat(&r_samplerate, NULL, &r_channels, NULL, NULL, &r_bits);
|
||||
mSystem->getDriverInfo(0, r_name, 255, 0);
|
||||
r_name[255] = '\0';
|
||||
int latency = 1000.0 * r_bufferlength * r_numbuffers /r_samplerate;
|
||||
|
||||
LL_INFOS("AppInit") << "FMOD device: "<< r_name << "\n"
|
||||
<< "FMOD Ex parameters: " << r_samplerate << " Hz * " << r_channels << " * " <<r_bits <<" bit\n"
|
||||
<< "\tbuffer " << r_bufferlength << " * " << r_numbuffers << " (" << latency <<"ms)" << LL_ENDL;
|
||||
LL_DEBUGS("AppInit") << "LLAudioEngine_FMODEX::init() FMOD initialized correctly" << LL_ENDL;
|
||||
|
||||
mInited = true;
|
||||
|
||||
@@ -304,10 +321,10 @@ std::string LLAudioEngine_FMODEX::getDriverName(bool verbose)
|
||||
U32 version;
|
||||
if(!Check_FMOD_Error(mSystem->getVersion(&version), "FMOD::System::getVersion"))
|
||||
{
|
||||
return llformat("FMOD Ex %1x.%02x.%02x", version >> 16, version >> 8 & 0x000000FF, version & 0x000000FF);
|
||||
return llformat("FMOD version %1x.%02x.%02x", version >> 16, version >> 8 & 0x000000FF, version & 0x000000FF);
|
||||
}
|
||||
}
|
||||
return "FMODEx";
|
||||
return "FMOD";
|
||||
}
|
||||
|
||||
|
||||
@@ -325,13 +342,12 @@ void LLAudioEngine_FMODEX::shutdown()
|
||||
{
|
||||
stopInternetStream();
|
||||
|
||||
llinfos << "About to LLAudioEngine::shutdown()" << llendl;
|
||||
LLAudioEngine::shutdown();
|
||||
|
||||
llinfos << "LLAudioEngine_FMODEX::shutdown() closing FMOD Ex" << llendl;
|
||||
llinfos << "LLAudioEngine_FMODEX::shutdown() closing FMOD" << llendl;
|
||||
mSystem->close();
|
||||
mSystem->release();
|
||||
llinfos << "LLAudioEngine_FMODEX::shutdown() done closing FMOD Ex" << llendl;
|
||||
llinfos << "LLAudioEngine_FMODEX::shutdown() done closing FMOD" << llendl;
|
||||
|
||||
delete mListenerp;
|
||||
mListenerp = NULL;
|
||||
@@ -358,7 +374,6 @@ bool LLAudioEngine_FMODEX::initWind()
|
||||
FMOD_DSP_DESCRIPTION dspdesc;
|
||||
memset(&dspdesc, 0, sizeof(FMOD_DSP_DESCRIPTION)); //Set everything to zero
|
||||
strncpy(dspdesc.name,"Wind Unit", sizeof(dspdesc.name)); //Set name to "Wind Unit"
|
||||
dspdesc.channels=2;
|
||||
dspdesc.read = &windCallback; //Assign callback.
|
||||
if(Check_FMOD_Error(mSystem->createDSP(&dspdesc, &mWindDSP), "FMOD::createDSP"))
|
||||
return false;
|
||||
|
||||
@@ -53,14 +53,7 @@ class LLStreamingAudioInterface
|
||||
virtual void setGain(F32 vol) = 0;
|
||||
virtual F32 getGain() = 0;
|
||||
virtual std::string getURL() = 0;
|
||||
|
||||
virtual bool supportsMetaData() = 0;
|
||||
virtual const LLSD *getMetaData() = 0;
|
||||
virtual bool supportsWaveData() = 0;
|
||||
virtual bool getWaveData(float* arr, S32 count, S32 stride = 1) = 0;
|
||||
|
||||
virtual bool supportsAdjustableBufferSizes(){return false;}
|
||||
virtual void setBufferSizes(U32 streambuffertime, U32 decodebuffertime){};
|
||||
virtual const LLSD *getMetaData() = 0; //return NULL if not supported.
|
||||
};
|
||||
|
||||
#endif // LL_STREAMINGAUDIO_H
|
||||
|
||||
@@ -54,11 +54,8 @@ class LLStreamingAudio_FMOD : public LLStreamingAudioInterface
|
||||
/*virtual*/ void setGain(F32 vol);
|
||||
/*virtual*/ F32 getGain();
|
||||
/*virtual*/ std::string getURL();
|
||||
/*virtual*/ const LLSD *getMetaData(){return mMetaData;} //return NULL if not supported.
|
||||
|
||||
/*virtual*/ bool supportsMetaData(){return true;}
|
||||
/*virtual*/ const LLSD *getMetaData(){return mMetaData;} //return NULL if not playing.
|
||||
/*virtual*/ bool supportsWaveData(){return false;}
|
||||
/*virtual*/ bool getWaveData(float* arr, S32 count, S32 stride = 1){return false;}
|
||||
private:
|
||||
LLAudioStreamManagerFMOD *mCurrentInternetStreamp;
|
||||
int mFMODInternetStreamChannel;
|
||||
|
||||
@@ -50,7 +50,7 @@ public:
|
||||
|
||||
const std::string& getURL() { return mInternetStreamURL; }
|
||||
|
||||
FMOD_OPENSTATE getOpenState(unsigned int* percentbuffered=NULL, bool* starving=NULL, bool* diskbusy=NULL);
|
||||
FMOD_OPENSTATE getOpenState();
|
||||
protected:
|
||||
FMOD::System* mSystem;
|
||||
FMOD::Channel* mStreamChannel;
|
||||
@@ -74,9 +74,7 @@ LLStreamingAudio_FMODEX::LLStreamingAudio_FMODEX(FMOD::System *system) :
|
||||
{
|
||||
// Number of milliseconds of audio to buffer for the audio card.
|
||||
// Must be larger than the usual Second Life frame stutter time.
|
||||
const U32 buffer_seconds = 10; //sec
|
||||
const U32 estimated_bitrate = 128; //kbit/sec
|
||||
mSystem->setStreamBufferSize(estimated_bitrate * buffer_seconds * 128/*bytes/kbit*/, FMOD_TIMEUNIT_RAWBYTES);
|
||||
mSystem->setStreamBufferSize(200, FMOD_TIMEUNIT_MS);
|
||||
|
||||
// Here's where we set the size of the network buffer and some buffering
|
||||
// parameters. In this case we want a network buffer of 16k, we want it
|
||||
@@ -145,10 +143,7 @@ void LLStreamingAudio_FMODEX::update()
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int progress;
|
||||
bool starving;
|
||||
bool diskbusy;
|
||||
FMOD_OPENSTATE open_state = mCurrentInternetStreamp->getOpenState(&progress, &starving, &diskbusy);
|
||||
FMOD_OPENSTATE open_state = mCurrentInternetStreamp->getOpenState();
|
||||
|
||||
if (open_state == FMOD_OPENSTATE_READY)
|
||||
{
|
||||
@@ -161,7 +156,6 @@ void LLStreamingAudio_FMODEX::update()
|
||||
// Reset volume to previously set volume
|
||||
setGain(getGain());
|
||||
mFMODInternetStreamChannelp->setPaused(false);
|
||||
mLastStarved.stop();
|
||||
}
|
||||
}
|
||||
else if(open_state == FMOD_OPENSTATE_ERROR)
|
||||
@@ -172,7 +166,6 @@ void LLStreamingAudio_FMODEX::update()
|
||||
|
||||
if(mFMODInternetStreamChannelp)
|
||||
{
|
||||
//llinfos << "progress = " << progress << llendl;
|
||||
if(!mMetaData)
|
||||
mMetaData = new LLSD;
|
||||
|
||||
@@ -242,29 +235,12 @@ void LLStreamingAudio_FMODEX::update()
|
||||
}
|
||||
}
|
||||
}
|
||||
if(starving)
|
||||
{
|
||||
if(!mLastStarved.getStarted())
|
||||
{
|
||||
llinfos << "Stream starvation detected! Muting stream audio until it clears." << llendl;
|
||||
llinfos << " (diskbusy="<<diskbusy<<")" << llendl;
|
||||
llinfos << " (progress="<<progress<<")" << llendl;
|
||||
mFMODInternetStreamChannelp->setMute(true);
|
||||
}
|
||||
mLastStarved.start();
|
||||
}
|
||||
else if(mLastStarved.getStarted() && mLastStarved.getElapsedTimeF32() > 1.f)
|
||||
{
|
||||
mLastStarved.stop();
|
||||
mFMODInternetStreamChannelp->setMute(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLStreamingAudio_FMODEX::stop()
|
||||
{
|
||||
mLastStarved.stop();
|
||||
if(mMetaData)
|
||||
{
|
||||
delete mMetaData;
|
||||
@@ -358,32 +334,6 @@ void LLStreamingAudio_FMODEX::setGain(F32 vol)
|
||||
}
|
||||
}
|
||||
|
||||
/*virtual*/ bool LLStreamingAudio_FMODEX::getWaveData(float* arr, S32 count, S32 stride/*=1*/)
|
||||
{
|
||||
if(!mFMODInternetStreamChannelp || !mCurrentInternetStreamp)
|
||||
return false;
|
||||
|
||||
bool muted=false;
|
||||
mFMODInternetStreamChannelp->getMute(&muted);
|
||||
if(muted)
|
||||
return false;
|
||||
|
||||
static std::vector<float> local_array(count); //Have to have an extra buffer to mix channels. Bleh.
|
||||
if(count > (S32)local_array.size()) //Expand the array if needed. Try to minimize allocation calls, so don't ever shrink.
|
||||
local_array.resize(count);
|
||||
|
||||
if( mFMODInternetStreamChannelp->getWaveData(&local_array[0],count,0) == FMOD_OK &&
|
||||
mFMODInternetStreamChannelp->getWaveData(&arr[0],count,1) == FMOD_OK )
|
||||
{
|
||||
for(S32 i = count-1;i>=0;i-=stride)
|
||||
{
|
||||
arr[i] += local_array[i];
|
||||
arr[i] *= .5f;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
// manager of possibly-multiple internet audio streams
|
||||
@@ -401,7 +351,7 @@ LLAudioStreamManagerFMODEX::LLAudioStreamManagerFMODEX(FMOD::System *system, con
|
||||
exinfo.cbsize = sizeof(exinfo);
|
||||
exinfo.suggestedsoundtype = FMOD_SOUND_TYPE_MPEG; //Hint to speed up loading.
|
||||
|
||||
FMOD_RESULT result = mSystem->createStream(url.c_str(), FMOD_2D | FMOD_NONBLOCKING | FMOD_IGNORETAGS, &exinfo, &mInternetStream);
|
||||
FMOD_RESULT result = mSystem->createStream(url.c_str(), FMOD_2D | FMOD_NONBLOCKING, &exinfo, &mInternetStream);
|
||||
|
||||
if (result!= FMOD_OK)
|
||||
{
|
||||
@@ -469,19 +419,9 @@ bool LLAudioStreamManagerFMODEX::stopStream()
|
||||
}
|
||||
}
|
||||
|
||||
FMOD_OPENSTATE LLAudioStreamManagerFMODEX::getOpenState(unsigned int* percentbuffered, bool* starving, bool* diskbusy)
|
||||
FMOD_OPENSTATE LLAudioStreamManagerFMODEX::getOpenState()
|
||||
{
|
||||
FMOD_OPENSTATE state;
|
||||
mInternetStream->getOpenState(&state,percentbuffered,starving,diskbusy);
|
||||
mInternetStream->getOpenState(&state,NULL,NULL,NULL);
|
||||
return state;
|
||||
}
|
||||
|
||||
void LLStreamingAudio_FMODEX::setBufferSizes(U32 streambuffertime, U32 decodebuffertime)
|
||||
{
|
||||
mSystem->setStreamBufferSize(streambuffertime/1000*128*128, FMOD_TIMEUNIT_RAWBYTES);
|
||||
FMOD_ADVANCEDSETTINGS settings;
|
||||
memset(&settings,0,sizeof(settings));
|
||||
settings.cbsize=sizeof(settings);
|
||||
settings.defaultDecodeBufferSize = decodebuffertime;//ms
|
||||
mSystem->setAdvancedSettings(&settings);
|
||||
}
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "stdtypes.h" // from llcommon
|
||||
|
||||
#include "llstreamingaudio.h"
|
||||
#include "lltimer.h"
|
||||
|
||||
//Stubs
|
||||
class LLAudioStreamManagerFMODEX;
|
||||
@@ -62,13 +61,8 @@ class LLStreamingAudio_FMODEX : public LLStreamingAudioInterface
|
||||
/*virtual*/ void setGain(F32 vol);
|
||||
/*virtual*/ F32 getGain();
|
||||
/*virtual*/ std::string getURL();
|
||||
/*virtual*/ const LLSD *getMetaData(){return mMetaData;} //return NULL if not supported.
|
||||
|
||||
/*virtual*/ bool supportsMetaData(){return true;}
|
||||
/*virtual*/ const LLSD *getMetaData(){return mMetaData;} //return NULL if not playing.
|
||||
/*virtual*/ bool supportsWaveData(){return true;}
|
||||
/*virtual*/ bool getWaveData(float* arr, S32 count, S32 stride = 1);
|
||||
/*virtual*/ bool supportsAdjustableBufferSizes(){return true;}
|
||||
/*virtual*/ void setBufferSizes(U32 streambuffertime, U32 decodebuffertime);
|
||||
private:
|
||||
FMOD::System *mSystem;
|
||||
|
||||
@@ -79,8 +73,6 @@ private:
|
||||
std::string mURL;
|
||||
F32 mGain;
|
||||
|
||||
LLTimer mLastStarved;
|
||||
|
||||
LLSD *mMetaData;
|
||||
};
|
||||
|
||||
|
||||
@@ -133,10 +133,10 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname)
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
// **********************************
|
||||
//**********************************
|
||||
LLAPRFile outfile ;
|
||||
outfile.open(out_fname,LL_APR_WPB);
|
||||
// **********************************
|
||||
//**********************************
|
||||
if (!outfile.getFileHandle())
|
||||
{
|
||||
llwarning("unable to open vorbis destination file for writing",0);
|
||||
@@ -308,9 +308,9 @@ BOOL decode_vorbis_file(LLVFS *vfs, const LLUUID &in_uuid, char *out_fname)
|
||||
|
||||
outfile.seek(SEEK_END,-fade_length*2);
|
||||
outfile.write(pcmout,2*fade_length); //write back xfaded last 16 samples
|
||||
// *******************
|
||||
//*******************
|
||||
outfile.close();
|
||||
// *******************
|
||||
//*******************
|
||||
|
||||
if ((36 == data_length) || (!(eof)))
|
||||
{
|
||||
|
||||
@@ -87,10 +87,10 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
|
||||
|
||||
error_msg.clear();
|
||||
|
||||
// ********************************
|
||||
//********************************
|
||||
LLAPRFile infile ;
|
||||
infile.open(in_fname,LL_APR_RB);
|
||||
// ********************************
|
||||
infile.open(in_fname,LL_APR_RB);
|
||||
//********************************
|
||||
if (!infile.getFileHandle())
|
||||
{
|
||||
error_msg = "CannotUploadSoundFile";
|
||||
@@ -159,9 +159,9 @@ S32 check_for_invalid_wav_formats(const std::string& in_fname, std::string& erro
|
||||
file_pos += (chunk_length + 8);
|
||||
chunk_length = 0;
|
||||
}
|
||||
// ****************
|
||||
//****************
|
||||
infile.close();
|
||||
// ****************
|
||||
//****************
|
||||
|
||||
if (!uncompressed_pcm)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
#include "llapr.h"
|
||||
|
||||
|
||||
//using namespace std;
|
||||
using namespace std;
|
||||
|
||||
#define INCHES_TO_METERS 0.02540005f
|
||||
|
||||
@@ -1575,7 +1575,7 @@ BOOL LLBVHLoader::serialize(LLDataPacker& dp)
|
||||
constraint_it++)
|
||||
{
|
||||
U8 byte = constraint_it->mChainLength;
|
||||
dp.packU8(byte, "chain_length");
|
||||
dp.packU8(byte, "chain_lenght");
|
||||
|
||||
byte = constraint_it->mConstraintType;
|
||||
dp.packU8(byte, "constraint_type");
|
||||
|
||||
@@ -56,7 +56,8 @@ LLCharacter::LLCharacter()
|
||||
mPreferredPelvisHeight( 0.f ),
|
||||
mSex( SEX_FEMALE ),
|
||||
mAppearanceSerialNum( 0 ),
|
||||
mSkeletonSerialNum( 0 )
|
||||
mSkeletonSerialNum( 0 ),
|
||||
mInAppearance( false )
|
||||
{
|
||||
llassert_always(sAllowInstancesChange) ;
|
||||
sInstances.push_back(this);
|
||||
@@ -194,19 +195,15 @@ void LLCharacter::requestStopMotion( LLMotion* motion)
|
||||
//-----------------------------------------------------------------------------
|
||||
// updateMotions()
|
||||
//-----------------------------------------------------------------------------
|
||||
static LLFastTimer::DeclareTimer FTM_UPDATE_ANIMATION("Update Animation");
|
||||
static LLFastTimer::DeclareTimer FTM_UPDATE_HIDDEN_ANIMATION("Update Hidden Anim");
|
||||
|
||||
void LLCharacter::updateMotions(e_update_t update_type)
|
||||
{
|
||||
LLFastTimer t(LLFastTimer::FTM_UPDATE_ANIMATION);
|
||||
if (update_type == HIDDEN_UPDATE)
|
||||
{
|
||||
LLFastTimer t(FTM_UPDATE_HIDDEN_ANIMATION);
|
||||
mMotionController.updateMotionsMinimal();
|
||||
}
|
||||
else
|
||||
{
|
||||
LLFastTimer t(FTM_UPDATE_ANIMATION);
|
||||
// unpause if the number of outstanding pause requests has dropped to the initial one
|
||||
if (mMotionController.isPaused() && mPauseRequest->getNumRefs() == 1)
|
||||
{
|
||||
|
||||
@@ -132,7 +132,7 @@ public:
|
||||
|
||||
virtual void addDebugText( const std::string& text ) = 0;
|
||||
|
||||
virtual const LLUUID& getID() const = 0;
|
||||
virtual const LLUUID& getID() = 0;
|
||||
//-------------------------------------------------------------------------
|
||||
// End Interface
|
||||
//-------------------------------------------------------------------------
|
||||
@@ -268,6 +268,10 @@ public:
|
||||
ESex getSex() const { return mSex; }
|
||||
void setSex( ESex sex ) { mSex = sex; }
|
||||
|
||||
// set appearance flag
|
||||
void setAppearanceFlag( bool flag ) { mInAppearance = flag; }
|
||||
bool getAppearanceFlag() { return mInAppearance; }
|
||||
|
||||
U32 getAppearanceSerialNum() const { return mAppearanceSerialNum; }
|
||||
void setAppearanceSerialNum( U32 num ) { mAppearanceSerialNum = num; }
|
||||
|
||||
@@ -289,6 +293,8 @@ protected:
|
||||
U32 mSkeletonSerialNum;
|
||||
LLAnimPauseRequest mPauseRequest;
|
||||
|
||||
BOOL mInAppearance;
|
||||
|
||||
private:
|
||||
// visual parameter stuff
|
||||
typedef std::map<S32, LLVisualParam *> visual_param_index_map_t;
|
||||
|
||||
@@ -1,25 +1,31 @@
|
||||
/**
|
||||
* @file llgesture.cpp
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
|
||||
* $LicenseInfo:firstyear=2002&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2002-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
* The source code in this file ("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 doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* 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;
|
||||
* version 2.1 of the License only.
|
||||
* 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, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* 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.
|
||||
* 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.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -3,25 +3,31 @@
|
||||
* @brief A gesture is a combination of a triggering chat phrase or
|
||||
* key, a sound, an animation, and a chat string.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2002&license=viewerlgpl$
|
||||
* $LicenseInfo:firstyear=2002&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2002-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
* The source code in this file ("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 doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* 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;
|
||||
* version 2.1 of the License only.
|
||||
* 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, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* 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.
|
||||
* 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.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -510,6 +510,20 @@ BOOL LLEyeMotion::onUpdate(F32 time, U8* joint_mask)
|
||||
vergence_quat.transQuat();
|
||||
right_eye_rot = vergence_quat * eye_jitter_rot * right_eye_rot;
|
||||
|
||||
//if in appearance, set the eyes straight forward
|
||||
if(mCharacter->getAppearanceFlag()) // no idea why this variable is reversed
|
||||
{
|
||||
LLVector3 forward(1.f, 0.0, 0.0);
|
||||
LLVector3 left;
|
||||
LLVector3 up;
|
||||
left.setVec(forward % forward);
|
||||
up.setVec(forward % left);
|
||||
target_eye_rot = LLQuaternion(forward, left, up);
|
||||
mLeftEyeState->setRotation( target_eye_rot );
|
||||
mRightEyeState->setRotation( target_eye_rot );
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
mLeftEyeState->setRotation( left_eye_rot );
|
||||
mRightEyeState->setRotation( right_eye_rot );
|
||||
|
||||
|
||||
@@ -480,7 +480,7 @@ LLPointer<LLJointState>& LLKeyframeMotion::getJointState(U32 index)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// getJoint()
|
||||
// getJoin()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLJoint* LLKeyframeMotion::getJoint(U32 index)
|
||||
{
|
||||
|
||||
@@ -637,9 +637,9 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
|
||||
motionp->fadeIn();
|
||||
}
|
||||
|
||||
// **********************
|
||||
//**********************
|
||||
// MOTION INACTIVE
|
||||
// **********************
|
||||
//**********************
|
||||
if (motionp->isStopped() && mAnimTime > motionp->getStopTime() + motionp->getEaseOutDuration())
|
||||
{
|
||||
// this motion has gone on too long, deactivate it
|
||||
@@ -659,9 +659,9 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
|
||||
}
|
||||
}
|
||||
|
||||
// **********************
|
||||
//**********************
|
||||
// MOTION EASE OUT
|
||||
// **********************
|
||||
//**********************
|
||||
else if (motionp->isStopped() && mAnimTime > motionp->getStopTime())
|
||||
{
|
||||
// is this the first iteration in the ease out phase?
|
||||
@@ -684,9 +684,9 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
|
||||
update_result = motionp->onUpdate(mAnimTime - motionp->mActivationTimestamp, last_joint_signature);
|
||||
}
|
||||
|
||||
// **********************
|
||||
//**********************
|
||||
// MOTION ACTIVE
|
||||
// **********************
|
||||
//**********************
|
||||
else if (mAnimTime > motionp->mActivationTimestamp + motionp->getEaseInDuration())
|
||||
{
|
||||
posep->setWeight(motionp->getFadeWeight());
|
||||
@@ -707,9 +707,9 @@ void LLMotionController::updateMotionsByType(LLMotion::LLMotionBlendType anim_ty
|
||||
update_result = motionp->onUpdate(mAnimTime - motionp->mActivationTimestamp, last_joint_signature);
|
||||
}
|
||||
|
||||
// **********************
|
||||
//**********************
|
||||
// MOTION EASE IN
|
||||
// **********************
|
||||
//**********************
|
||||
else if (mAnimTime >= motionp->mActivationTimestamp)
|
||||
{
|
||||
if (mLastTime < motionp->mActivationTimestamp)
|
||||
|
||||
@@ -2,25 +2,31 @@
|
||||
* @file llmultigesture.cpp
|
||||
* @brief Gestures that are asset-based and can have multiple steps.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2004&license=viewerlgpl$
|
||||
* $LicenseInfo:firstyear=2004&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2004-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
* The source code in this file ("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 doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* 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;
|
||||
* version 2.1 of the License only.
|
||||
* 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, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* 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.
|
||||
* 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.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
@@ -44,7 +50,6 @@ const S32 GESTURE_VERSION = 2;
|
||||
LLMultiGesture::LLMultiGesture()
|
||||
: mKey(),
|
||||
mMask(),
|
||||
mName(),
|
||||
mTrigger(),
|
||||
mReplaceText(),
|
||||
mSteps(),
|
||||
@@ -287,27 +292,20 @@ BOOL LLGestureStepAnimation::deserialize(LLDataPacker& dp)
|
||||
dp.unpackU32(mFlags, "flags");
|
||||
return TRUE;
|
||||
}
|
||||
// *NOTE: result is translated in LLPreviewGesture::getLabel()
|
||||
std::vector<std::string> LLGestureStepAnimation::getLabel() const
|
||||
|
||||
std::string LLGestureStepAnimation::getLabel() const
|
||||
{
|
||||
std::vector<std::string> strings;
|
||||
|
||||
// std::string label;
|
||||
std::string label;
|
||||
if (mFlags & ANIM_FLAG_STOP)
|
||||
{
|
||||
strings.push_back( "AnimFlagStop");
|
||||
|
||||
// label = "Stop Animation: ";
|
||||
label = "Stop Animation: ";
|
||||
}
|
||||
else
|
||||
{
|
||||
strings.push_back( "AnimFlagStart");
|
||||
|
||||
// label = "Start Animation: ";
|
||||
label = "Start Animation: ";
|
||||
}
|
||||
strings.push_back( mAnimName);
|
||||
// label += mAnimName;
|
||||
return strings;
|
||||
label += mAnimName;
|
||||
return label;
|
||||
}
|
||||
|
||||
void LLGestureStepAnimation::dump()
|
||||
@@ -361,15 +359,12 @@ BOOL LLGestureStepSound::deserialize(LLDataPacker& dp)
|
||||
dp.unpackU32(mFlags, "flags");
|
||||
return TRUE;
|
||||
}
|
||||
// *NOTE: result is translated in LLPreviewGesture::getLabel()
|
||||
std::vector<std::string> LLGestureStepSound::getLabel() const
|
||||
|
||||
std::string LLGestureStepSound::getLabel() const
|
||||
{
|
||||
std::vector<std::string> strings;
|
||||
strings.push_back( "Sound");
|
||||
strings.push_back( mSoundName);
|
||||
// std::string label("Sound: ");
|
||||
// label += mSoundName;
|
||||
return strings;
|
||||
std::string label("Sound: ");
|
||||
label += mSoundName;
|
||||
return label;
|
||||
}
|
||||
|
||||
void LLGestureStepSound::dump()
|
||||
@@ -419,13 +414,12 @@ BOOL LLGestureStepChat::deserialize(LLDataPacker& dp)
|
||||
dp.unpackU32(mFlags, "flags");
|
||||
return TRUE;
|
||||
}
|
||||
// *NOTE: result is translated in LLPreviewGesture::getLabel()
|
||||
std::vector<std::string> LLGestureStepChat::getLabel() const
|
||||
|
||||
std::string LLGestureStepChat::getLabel() const
|
||||
{
|
||||
std::vector<std::string> strings;
|
||||
strings.push_back("Chat");
|
||||
strings.push_back(mChatText);
|
||||
return strings;
|
||||
std::string label("Chat: ");
|
||||
label += mChatText;
|
||||
return label;
|
||||
}
|
||||
|
||||
void LLGestureStepChat::dump()
|
||||
@@ -473,31 +467,22 @@ BOOL LLGestureStepWait::deserialize(LLDataPacker& dp)
|
||||
dp.unpackU32(mFlags, "flags");
|
||||
return TRUE;
|
||||
}
|
||||
// *NOTE: result is translated in LLPreviewGesture::getLabel()
|
||||
std::vector<std::string> LLGestureStepWait::getLabel() const
|
||||
|
||||
std::string LLGestureStepWait::getLabel() const
|
||||
{
|
||||
std::vector<std::string> strings;
|
||||
strings.push_back( "Wait" );
|
||||
|
||||
// std::string label("--- Wait: ");
|
||||
std::string label("--- Wait: ");
|
||||
if (mFlags & WAIT_FLAG_TIME)
|
||||
{
|
||||
char buffer[64]; /* Flawfinder: ignore */
|
||||
snprintf(buffer, sizeof(buffer), "%.1f seconds", (double)mWaitSeconds); /* Flawfinder: ignore */
|
||||
strings.push_back(buffer);
|
||||
// label += buffer;
|
||||
label += buffer;
|
||||
}
|
||||
else if (mFlags & WAIT_FLAG_ALL_ANIM)
|
||||
{
|
||||
strings.push_back("until animations are done");
|
||||
// label += "until animations are done";
|
||||
}
|
||||
else
|
||||
{
|
||||
strings.push_back("");
|
||||
label += "until animations are done";
|
||||
}
|
||||
|
||||
return strings;
|
||||
return label;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -70,10 +70,6 @@ public:
|
||||
KEY mKey;
|
||||
MASK mMask;
|
||||
|
||||
// This name can be empty if the inventory item is not around and
|
||||
// the gesture manager has not yet set the name
|
||||
std::string mName;
|
||||
|
||||
// String, like "/foo" or "hello" that makes it play
|
||||
std::string mTrigger;
|
||||
|
||||
@@ -134,7 +130,7 @@ public:
|
||||
virtual EStepType getType() = 0;
|
||||
|
||||
// Return a user-readable label for this step
|
||||
virtual std::vector<std::string> getLabel() const = 0;
|
||||
virtual std::string getLabel() const = 0;
|
||||
|
||||
virtual S32 getMaxSerialSize() const = 0;
|
||||
virtual BOOL serialize(LLDataPacker& dp) const = 0;
|
||||
@@ -156,7 +152,7 @@ public:
|
||||
|
||||
virtual EStepType getType() { return STEP_ANIMATION; }
|
||||
|
||||
virtual std::vector<std::string> getLabel() const;
|
||||
virtual std::string getLabel() const;
|
||||
|
||||
virtual S32 getMaxSerialSize() const;
|
||||
virtual BOOL serialize(LLDataPacker& dp) const;
|
||||
@@ -179,7 +175,7 @@ public:
|
||||
|
||||
virtual EStepType getType() { return STEP_SOUND; }
|
||||
|
||||
virtual std::vector<std::string> getLabel() const;
|
||||
virtual std::string getLabel() const;
|
||||
|
||||
virtual S32 getMaxSerialSize() const;
|
||||
virtual BOOL serialize(LLDataPacker& dp) const;
|
||||
@@ -202,7 +198,7 @@ public:
|
||||
|
||||
virtual EStepType getType() { return STEP_CHAT; }
|
||||
|
||||
virtual std::vector<std::string> getLabel() const;
|
||||
virtual std::string getLabel() const;
|
||||
|
||||
virtual S32 getMaxSerialSize() const;
|
||||
virtual BOOL serialize(LLDataPacker& dp) const;
|
||||
@@ -227,7 +223,7 @@ public:
|
||||
|
||||
virtual EStepType getType() { return STEP_WAIT; }
|
||||
|
||||
virtual std::vector<std::string> getLabel() const;
|
||||
virtual std::string getLabel() const;
|
||||
|
||||
virtual S32 getMaxSerialSize() const;
|
||||
virtual BOOL serialize(LLDataPacker& dp) const;
|
||||
|
||||
@@ -2,25 +2,31 @@
|
||||
* @file llvisualparam.cpp
|
||||
* @brief Implementation of LLPolyMesh class.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
* The source code in this file ("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 doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* 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;
|
||||
* version 2.1 of the License only.
|
||||
* 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, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* 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.
|
||||
* 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.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -2,25 +2,31 @@
|
||||
* @file llvisualparam.h
|
||||
* @brief Implementation of LLPolyMesh class.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
|
||||
* $LicenseInfo:firstyear=2001&license=viewergpl$
|
||||
*
|
||||
* Copyright (c) 2001-2009, Linden Research, Inc.
|
||||
*
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
* The source code in this file ("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 doc/GPL-license.txt in this distribution, or
|
||||
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
|
||||
*
|
||||
* 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;
|
||||
* version 2.1 of the License only.
|
||||
* 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, or
|
||||
* online at
|
||||
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
|
||||
*
|
||||
* 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.
|
||||
* 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.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
||||
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
||||
* COMPLETENESS OR PERFORMANCE.
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
|
||||
@@ -15,11 +15,8 @@ include_directories(
|
||||
)
|
||||
|
||||
set(llcommon_SOURCE_FILES
|
||||
aiframetimer.cpp
|
||||
imageids.cpp
|
||||
indra_constants.cpp
|
||||
llallocator.cpp
|
||||
llallocator_heap_profile.cpp
|
||||
indra_constants.cpp
|
||||
llapp.cpp
|
||||
llapr.cpp
|
||||
llaprpool.cpp
|
||||
@@ -29,23 +26,16 @@ set(llcommon_SOURCE_FILES
|
||||
llbase64.cpp
|
||||
llcommon.cpp
|
||||
llcommonutils.cpp
|
||||
llcoros.cpp
|
||||
llcrc.cpp
|
||||
llcriticaldamp.cpp
|
||||
llcursortypes.cpp
|
||||
lldate.cpp
|
||||
lldependencies.cpp
|
||||
lldictionary.cpp
|
||||
llerror.cpp
|
||||
llerrorthread.cpp
|
||||
llevent.cpp
|
||||
lleventapi.cpp
|
||||
lleventcoro.cpp
|
||||
lleventdispatcher.cpp
|
||||
lleventfilter.cpp
|
||||
llevents.cpp
|
||||
lleventtimer.cpp
|
||||
llfasttimer_class.cpp
|
||||
llfasttimer.cpp
|
||||
llfile.cpp
|
||||
llfindlocale.cpp
|
||||
llfixedbuffer.cpp
|
||||
@@ -61,11 +51,9 @@ set(llcommon_SOURCE_FILES
|
||||
llmd5.cpp
|
||||
llmemory.cpp
|
||||
llmemorystream.cpp
|
||||
llmemtype.cpp
|
||||
llmetrics.cpp
|
||||
llmortician.cpp
|
||||
lloptioninterface.cpp
|
||||
llptrto.cpp
|
||||
llprocesslauncher.cpp
|
||||
llprocessor.cpp
|
||||
llqueuedthread.cpp
|
||||
@@ -91,7 +79,6 @@ set(llcommon_SOURCE_FILES
|
||||
lluri.cpp
|
||||
lluuid.cpp
|
||||
llworkerthread.cpp
|
||||
ll_template_cast.h
|
||||
metaclass.cpp
|
||||
metaproperty.cpp
|
||||
reflective.cpp
|
||||
@@ -102,7 +89,6 @@ set(llcommon_SOURCE_FILES
|
||||
set(llcommon_HEADER_FILES
|
||||
CMakeLists.txt
|
||||
|
||||
aiframetimer.h
|
||||
aithreadsafe.h
|
||||
bitpack.h
|
||||
ctype_workaround.h
|
||||
@@ -112,8 +98,6 @@ set(llcommon_HEADER_FILES
|
||||
linden_common.h
|
||||
linked_lists.h
|
||||
llaccountingcost.h
|
||||
llallocator.h
|
||||
llallocator_heap_profile.h
|
||||
llagentconstants.h
|
||||
llavatarname.h
|
||||
llapp.h
|
||||
@@ -121,7 +105,6 @@ set(llcommon_HEADER_FILES
|
||||
llaprpool.h
|
||||
llassettype.h
|
||||
llassoclist.h
|
||||
llatomic.h
|
||||
llavatarconstants.h
|
||||
llbase32.h
|
||||
llbase64.h
|
||||
@@ -130,7 +113,6 @@ set(llcommon_HEADER_FILES
|
||||
llclickaction.h
|
||||
llcommon.h
|
||||
llcommonutils.h
|
||||
llcoros.h
|
||||
llcrc.h
|
||||
llcriticaldamp.h
|
||||
llcursortypes.h
|
||||
@@ -138,7 +120,6 @@ set(llcommon_HEADER_FILES
|
||||
lldarrayptr.h
|
||||
lldate.h
|
||||
lldefs.h
|
||||
lldependencies.h
|
||||
lldeleteutils.h
|
||||
lldepthstack.h
|
||||
lldictionary.h
|
||||
@@ -151,16 +132,10 @@ set(llcommon_HEADER_FILES
|
||||
llerrorlegacy.h
|
||||
llerrorthread.h
|
||||
llevent.h
|
||||
lleventapi.h
|
||||
lleventcoro.h
|
||||
lleventdispatcher.h
|
||||
lleventfilter.h
|
||||
llevents.h
|
||||
lleventemitter.h
|
||||
llextendedstatus.h
|
||||
lleventtimer.h
|
||||
llfasttimer.h
|
||||
llfasttimer_class.h
|
||||
llfile.h
|
||||
llfindlocale.h
|
||||
llfixedbuffer.h
|
||||
@@ -196,7 +171,6 @@ set(llcommon_HEADER_FILES
|
||||
llprocessor.h
|
||||
llptrskiplist.h
|
||||
llptrskipmap.h
|
||||
llptrto.h
|
||||
llqueuedthread.h
|
||||
llrand.h
|
||||
llrefcount.h
|
||||
@@ -229,7 +203,8 @@ set(llcommon_HEADER_FILES
|
||||
lluri.h
|
||||
lluuid.h
|
||||
lluuidhashmap.h
|
||||
llversionviewer.h.in
|
||||
llversionserver.h
|
||||
llversionviewer.h
|
||||
llworkerthread.h
|
||||
metaclass.h
|
||||
metaclasst.h
|
||||
|
||||
@@ -1,180 +0,0 @@
|
||||
/**
|
||||
* @file aiframetimer.cpp
|
||||
*
|
||||
* Copyright (c) 2011, 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.
|
||||
*
|
||||
* 06/08/2011
|
||||
* - Initial version, written by Aleric Inglewood @ SL
|
||||
*/
|
||||
|
||||
// An AIFrameTimer object provides a callback API for timer events.
|
||||
//
|
||||
// Typical usage:
|
||||
//
|
||||
// // Any thread.
|
||||
// AIFrameTimer timer;
|
||||
//
|
||||
// ...
|
||||
// // Any thread (after successful construction is guaranteed).
|
||||
// timer.create(5.5, boost::bind(&the_callback, <optional params>)); // Call the_callback(<optional params>) in 5.5 seconds.
|
||||
//
|
||||
// The callback function is always called by the main thread and should therefore
|
||||
// be light weight.
|
||||
//
|
||||
// If timer.cancel() is called before the timer expires, then the callback
|
||||
// function isn't called. If cancel() is called by another thread than the
|
||||
// main thread, then it is possible that the callback function is called
|
||||
// even while still inside cancel(), but as soon as cancel() returned it
|
||||
// is guarenteed that the callback function won't be called anymore.
|
||||
// Hence, if the callback function is a member of some object then
|
||||
// cancel() must be called before the destruction of that object (ie from
|
||||
// it's destructor). Calling cancel() multiple times is not a problem.
|
||||
// Note: if cancel() is called while the callback function is being
|
||||
// called then cancel() will block until the callback function returned.
|
||||
//
|
||||
// The timer object can be reused (by calling create() again), but
|
||||
// only after either the callback function was called, or after cancel()
|
||||
// returned. Most notably, you can call create() again from inside the
|
||||
// callback function to "restart" the timer.
|
||||
//
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "aiframetimer.h"
|
||||
|
||||
static F64 const NEVER = 1e16; // 317 million years.
|
||||
|
||||
F64 AIFrameTimer::sNextExpiration;
|
||||
AIFrameTimer::timer_list_type AIFrameTimer::sTimerList;
|
||||
LLMutex AIFrameTimer::sMutex;
|
||||
|
||||
// Notes on thread-safety of AIRunningFrameTimer (continued from aiframetimer.h)
|
||||
//
|
||||
// Most notably, the constructor and init() should be called as follows:
|
||||
// 1) The object is constructed (AIRunningFrameTimer::AIRunningFrameTimer).
|
||||
// 2) The lock is obtained.
|
||||
// 3) The object is inserted in the list (operator<(AIRunningFrameTimer const&, AIRunningFrameTimer const&)).
|
||||
// 4) The object is initialized (AIRunningFrameTimer::init).
|
||||
// 5) The lock is released.
|
||||
// This assures that the object is not yet shared at the moment that it is initialized.
|
||||
|
||||
void AIFrameTimer::create(F64 expiration, signal_type::slot_type const& slot)
|
||||
{
|
||||
AIRunningFrameTimer new_timer(expiration, this);
|
||||
sMutex.lock();
|
||||
llassert(mHandle.mRunningTimer == sTimerList.end()); // Create may only be called when the timer isn't already running.
|
||||
mHandle.init(sTimerList.insert(new_timer), slot);
|
||||
sNextExpiration = sTimerList.begin()->expiration();
|
||||
sMutex.unlock();
|
||||
}
|
||||
|
||||
void AIFrameTimer::cancel(void)
|
||||
{
|
||||
// In order to stop us from returning from cancel() while
|
||||
// the callback function is being called (which is done
|
||||
// in AIFrameTimer::handleExpiration after obtaining the
|
||||
// mHandle.mMutex lock), we start with trying to obtain
|
||||
// it here and as such wait till the callback function
|
||||
// returned.
|
||||
mHandle.mMutex.lock();
|
||||
// Next we have to grab this lock in order to stop
|
||||
// AIFrameTimer::handleExpiration from even entering
|
||||
// in the case we manage to get it first.
|
||||
sMutex.lock();
|
||||
if (mHandle.mRunningTimer != sTimerList.end())
|
||||
{
|
||||
sTimerList.erase(mHandle.mRunningTimer);
|
||||
mHandle.mRunningTimer = sTimerList.end();
|
||||
sNextExpiration = sTimerList.empty() ? NEVER : sTimerList.begin()->expiration();
|
||||
}
|
||||
sMutex.unlock();
|
||||
mHandle.mMutex.unlock();
|
||||
}
|
||||
|
||||
void AIFrameTimer::handleExpiration(F64 current_frame_time)
|
||||
{
|
||||
sMutex.lock();
|
||||
for(;;)
|
||||
{
|
||||
if (sTimerList.empty())
|
||||
{
|
||||
// No running timers left.
|
||||
sNextExpiration = NEVER;
|
||||
break;
|
||||
}
|
||||
timer_list_type::iterator running_timer = sTimerList.begin();
|
||||
sNextExpiration = running_timer->expiration();
|
||||
if (sNextExpiration > current_frame_time)
|
||||
{
|
||||
// Didn't expire yet.
|
||||
break;
|
||||
}
|
||||
|
||||
// Obtain handle of running timer through the associated AIFrameTimer object.
|
||||
// Note that if the AIFrameTimer object was destructed (when running_timer->getTimer()
|
||||
// would return an invalid pointer) then it called cancel(), so we can't be here.
|
||||
Handle& handle(running_timer->getTimer()->mHandle);
|
||||
llassert_always(running_timer == handle.mRunningTimer);
|
||||
|
||||
// We're going to erase this timer, so stop cancel() from doing the same.
|
||||
handle.mRunningTimer = sTimerList.end();
|
||||
|
||||
// We keep handle.mMutex during the callback to prevent the thread that
|
||||
// owns the AIFrameTimer from deleting the callback function while we
|
||||
// call it: in order to do so it first has to call cancel(), which will
|
||||
// block until we release this mutex again, or we won't call the callback
|
||||
// function here because the trylock fails.
|
||||
//
|
||||
// Assuming the main thread arrived here, there are two possible states
|
||||
// for the other thread that tries to delete the callback function,
|
||||
// right after calling the cancel() function too:
|
||||
//
|
||||
// 1. It hasn't obtained the first lock yet, we obtain the handle.mMutex
|
||||
// lock and the other thread will stall on the first line of cancel().
|
||||
// After do_callback returns, the other thread will do nothing because
|
||||
// handle.mRunningTimer equals sTimerList.end(), exit the function and
|
||||
// (possibly) delete the callback object, but that is ok as we already
|
||||
// returned from the callback function.
|
||||
//
|
||||
// 2. It already called cancel() and hangs on the second line trying to
|
||||
// obtain sMutex.lock(). The trylock below fails and we never call the
|
||||
// callback function. We erase the running timer here and release sMutex
|
||||
// at the end, after which the other thread does nothing because
|
||||
// handle.mRunningTimer equals sTimerList.end(), exits the function and
|
||||
// (possibly) deletes the callback object.
|
||||
//
|
||||
// Note that if the other thread actually obtained the sMutex then we
|
||||
// can't be here: this is still inside the critical area of sMutex.
|
||||
if (handle.mMutex.tryLock()) // If this fails then another thread is in the process of cancelling this timer, so do nothing.
|
||||
{
|
||||
sMutex.unlock();
|
||||
running_timer->do_callback(); // May not throw exceptions.
|
||||
sMutex.lock();
|
||||
handle.mMutex.unlock(); // Allow other thread to return from cancel() and possibly delete the callback object.
|
||||
}
|
||||
|
||||
// Erase the timer from the running list.
|
||||
sTimerList.erase(running_timer);
|
||||
}
|
||||
sMutex.unlock();
|
||||
}
|
||||
|
||||
@@ -1,155 +0,0 @@
|
||||
/**
|
||||
* @file aiframetimer.h
|
||||
* @brief Implementation of AIFrameTimer.
|
||||
*
|
||||
* Copyright (c) 2011, 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.
|
||||
*
|
||||
* 05/08/2011
|
||||
* Initial version, written by Aleric Inglewood @ SL
|
||||
*/
|
||||
|
||||
#ifndef AIFRAMETIMER_H
|
||||
#define AIFRAMETIMER_H
|
||||
|
||||
#include "llframetimer.h"
|
||||
#include "llthread.h"
|
||||
#include <boost/signals2.hpp>
|
||||
#include <set>
|
||||
|
||||
class LL_COMMON_API AIFrameTimer
|
||||
{
|
||||
protected:
|
||||
typedef boost::signals2::signal<void (void)> signal_type;
|
||||
|
||||
private:
|
||||
// Use separate struct for this object because it is non-copyable.
|
||||
struct Signal {
|
||||
signal_type mSignal;
|
||||
};
|
||||
|
||||
// Notes on Thread-Safety
|
||||
//
|
||||
// This is the type of the objects stored in AIFrameTimer::sTimerList, and as such leans
|
||||
// for it's thread-safety on the same lock as is used for that std::multiset as follows.
|
||||
// An arbitrary thread can create, insert and initialize this object. Other threads can
|
||||
// not access it until that has completed.
|
||||
//
|
||||
// After creation two threads can access it: the thread that created it (owns the
|
||||
// AIFrameTimer object, which has an mHandle that points to this object), or the main
|
||||
// thread by finding it in sTimerList.
|
||||
//
|
||||
// See aiframetimer.cpp for more notes.
|
||||
class AIRunningFrameTimer {
|
||||
private:
|
||||
F64 mExpire; // Time at which the timer expires, in seconds since application start (compared to LLFrameTimer::sFrameTime).
|
||||
AIFrameTimer* mTimer; // The actual timer.
|
||||
// Can be mutable, since only the mExpire is used for ordering this object in the multiset AIFrameTimer::sTimerList.
|
||||
mutable Signal* mCallback; // Pointer to callback struct, or NULL when the object wasn't added to sTimerList yet.
|
||||
|
||||
public:
|
||||
AIRunningFrameTimer(F64 expiration, AIFrameTimer* timer) : mExpire(LLFrameTimer::getElapsedSeconds() + expiration), mCallback(NULL), mTimer(timer) { }
|
||||
~AIRunningFrameTimer() { delete mCallback; }
|
||||
|
||||
// This function is called after the final object was added to sTimerList (where it is initialized in-place).
|
||||
void init(signal_type::slot_type const& slot) const
|
||||
{
|
||||
// We may only call init() once.
|
||||
llassert(!mCallback);
|
||||
mCallback = new Signal;
|
||||
mCallback->mSignal.connect(slot);
|
||||
}
|
||||
|
||||
// Order AIFrameTimer::sTimerList so that the timer that expires first is up front.
|
||||
friend bool operator<(AIRunningFrameTimer const& ft1, AIRunningFrameTimer const& ft2) { return ft1.mExpire < ft2.mExpire; }
|
||||
|
||||
void do_callback(void) const { mCallback->mSignal(); }
|
||||
F64 expiration(void) const { return mExpire; }
|
||||
AIFrameTimer* getTimer(void) const { return mTimer; }
|
||||
|
||||
#if LL_DEBUG
|
||||
// May not copy this object after it was initialized.
|
||||
AIRunningFrameTimer(AIRunningFrameTimer const& running_frame_timer) :
|
||||
mExpire(running_frame_timer.mExpire), mCallback(running_frame_timer.mCallback), mTimer(running_frame_timer.mTimer)
|
||||
{ llassert(!mCallback); }
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef std::multiset<AIRunningFrameTimer> timer_list_type;
|
||||
|
||||
static LLMutex sMutex; // Mutex for the two global variables below.
|
||||
static timer_list_type sTimerList; // List with all running timers.
|
||||
static F64 sNextExpiration; // Cache of smallest value in sTimerList.
|
||||
friend class LLFrameTimer; // Access to sNextExpiration.
|
||||
|
||||
class Handle {
|
||||
public:
|
||||
timer_list_type::iterator mRunningTimer; // Points to the running timer, or to sTimerList.end() when not running.
|
||||
// Access to this iterator is protected by the AIFrameTimer::sMutex!
|
||||
LLMutex mMutex; // A mutex used to protect us from deletion of the callback object while
|
||||
// calling the callback function in the case of simultaneous expiration
|
||||
// and cancellation by the thread owning the AIFrameTimer (by calling
|
||||
// AIFrameTimer::cancel).
|
||||
|
||||
// Constructor for a not-running timer.
|
||||
Handle(void) : mRunningTimer(sTimerList.end()) { }
|
||||
|
||||
// Actual initialization used by AIFrameTimer::create.
|
||||
void init(timer_list_type::iterator const& running_timer, signal_type::slot_type const& slot)
|
||||
{
|
||||
// Locking AIFrameTimer::sMutex is not neccessary here, because we're creating
|
||||
// the object and no other thread knows of mRunningTimer at this point.
|
||||
mRunningTimer = running_timer;
|
||||
mRunningTimer->init(slot);
|
||||
}
|
||||
|
||||
private:
|
||||
// LLMutex has no assignment operator.
|
||||
Handle& operator=(Handle const&) { return *this; }
|
||||
};
|
||||
|
||||
Handle mHandle;
|
||||
|
||||
public:
|
||||
// Construct an AIFrameTimer that is not running.
|
||||
AIFrameTimer(void) { }
|
||||
|
||||
// Construction of a running AIFrameTimer with expiration time expiration in seconds, and callback slot.
|
||||
AIFrameTimer(F64 expiration, signal_type::slot_type const& slot) { create(expiration, slot); }
|
||||
|
||||
// Destructing the AIFrameTimer object terminates the running timer (if still running).
|
||||
// Note that cancel() must have returned BEFORE anything is destructed that would disallow the callback function to be called.
|
||||
// So, if the AIFrameTimer is a member of an object whose callback function is called then cancel() has
|
||||
// to be called manually (or from the destructor of THAT object), before that object is destructed.
|
||||
// Cancel may be called multiple times.
|
||||
~AIFrameTimer() { cancel(); }
|
||||
|
||||
void create(F64 expiration, signal_type::slot_type const& slot);
|
||||
void cancel(void);
|
||||
|
||||
bool isRunning(void) const { bool running; sMutex.lock(); running = mHandle.mRunningTimer != sTimerList.end(); sMutex.unlock(); return running; }
|
||||
|
||||
protected:
|
||||
static void handleExpiration(F64 current_frame_time);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -26,65 +26,8 @@
|
||||
*
|
||||
* 31/03/2010
|
||||
* Initial version, written by Aleric Inglewood @ SL
|
||||
*
|
||||
* 14/03/2012
|
||||
* Added AIThreadSafeSingleThread and friends.
|
||||
* Added AIAccessConst (and derived AIAccess from it) to allow read
|
||||
* access to a const AIThreadSafeSimple.
|
||||
*/
|
||||
|
||||
// This file defines wrapper template classes for arbitrary types T
|
||||
// adding locking to the instance and shielding it from access
|
||||
// without first being locked.
|
||||
//
|
||||
// Locking and getting access works by creating a temporary (local)
|
||||
// access object that takes the wrapper class as argument. Creating
|
||||
// the access object obtains the lock, while destructing it releases
|
||||
// the lock.
|
||||
//
|
||||
// There are three types of wrapper classes:
|
||||
// AIThreadSafe, AIThreadSafeSimple and AIThreadSafeSingleThread.
|
||||
//
|
||||
// AIThreadSafe is for use with the access classes:
|
||||
// AIReadAccessConst, AIReadAccess and AIWriteAccess.
|
||||
//
|
||||
// AIThreadSafeSimple is for use with the access classes:
|
||||
// AIAccessConst and AIAccess.
|
||||
//
|
||||
// AIThreadSafeSingleThread is for use with the access classes:
|
||||
// AISTAccessConst and AISTAccess.
|
||||
//
|
||||
// AIReadAccessConst provides read access to a const AIThreadSafe.
|
||||
// AIReadAccess provides read access to a non-const AIThreadSafe.
|
||||
// AIWriteAccess provides read/write access to a non-const AIThreadSafe.
|
||||
//
|
||||
// AIAccessConst provides read access to a const AIThreadSafeSimple.
|
||||
// AIAccess provides read/write access to a non-const AIThreadSafeSimple.
|
||||
//
|
||||
// AISTAccessConst provides read access to a const AIThreadSafeSingleThread.
|
||||
// AISTAccess provides read/write access to a non-const AIThreadSafeSingleThread.
|
||||
//
|
||||
// Thus, AIThreadSafe is to protect objects with a read/write lock,
|
||||
// AIThreadSafeSimple is to protect objects with a single mutex,
|
||||
// and AIThreadSafeSingleThread doesn't do any locking but makes sure
|
||||
// (in Debug mode) that the wrapped object is only accessed by one thread.
|
||||
//
|
||||
// Each wrapper class allows its wrapped object to be constructed
|
||||
// with arbitrary parameters by using operator new with placement;
|
||||
// for example, to instantiate a class Foo with read/write locking:
|
||||
//
|
||||
// AIThreadSafe<Foo> foo(new (foo.memory()) Foo(param1, param2, ...));
|
||||
//
|
||||
// Each wrapper class has a derived class that end on 'DC' (which
|
||||
// stand for Default Constructed): AIThreadSafeDC, AIThreadSafeSimpleDC
|
||||
// and AIThreadSafeSingleThreadDC. The default constructors of those
|
||||
// wrapper classes cause the wrapped instance to be default constructed
|
||||
// as well. They also provide a general one-parameter constructor.
|
||||
// For example:
|
||||
//
|
||||
// AIThreadSafeDC<Foo> foo; // Default constructed Foo.
|
||||
// AIThreadSafeDC<Foo> foo(3.4); // Foo with one constructor parameter.
|
||||
//
|
||||
#ifndef AITHREADSAFE_H
|
||||
#define AITHREADSAFE_H
|
||||
|
||||
@@ -106,10 +49,15 @@
|
||||
template<typename T> struct AIReadAccessConst;
|
||||
template<typename T> struct AIReadAccess;
|
||||
template<typename T> struct AIWriteAccess;
|
||||
template<typename T> struct AIAccessConst;
|
||||
template<typename T> struct AIAccess;
|
||||
template<typename T> struct AISTAccessConst;
|
||||
template<typename T> struct AISTAccess;
|
||||
|
||||
#if LL_WINDOWS
|
||||
template<typename T> class AIThreadSafeBits;
|
||||
template<typename T>
|
||||
struct AIThreadSafeWindowsHack {
|
||||
AIThreadSafeWindowsHack(AIThreadSafeBits<T>& var, T* object);
|
||||
};
|
||||
#endif
|
||||
|
||||
template<typename T>
|
||||
class AIThreadSafeBits
|
||||
@@ -132,15 +80,10 @@ public:
|
||||
// Only for use by AITHREADSAFE, see below.
|
||||
void* memory() const { return const_cast<long*>(&mMemory[0]); }
|
||||
|
||||
// Cast a T* back to AIThreadSafeBits<T>. This is the inverse of memory().
|
||||
template<typename T2>
|
||||
static AIThreadSafeBits<T2>* wrapper_cast(T2* ptr)
|
||||
{ return reinterpret_cast<AIThreadSafeBits<T2>*>(reinterpret_cast<char*>(ptr) - offsetof(AIThreadSafeBits<T2>, mMemory[0])); }
|
||||
template<typename T2>
|
||||
static AIThreadSafeBits<T2> const* wrapper_cast(T2 const* ptr)
|
||||
{ return reinterpret_cast<AIThreadSafeBits<T2> const*>(reinterpret_cast<char const*>(ptr) - offsetof(AIThreadSafeBits<T2>, mMemory[0])); }
|
||||
|
||||
protected:
|
||||
#if LL_WINDOWS
|
||||
template<typename T2> friend struct AIThreadSafeWindowsHack;
|
||||
#endif
|
||||
// Accessors.
|
||||
T const* ptr() const { return reinterpret_cast<T const*>(mMemory); }
|
||||
T* ptr() { return reinterpret_cast<T*>(mMemory); }
|
||||
@@ -242,14 +185,6 @@ public:
|
||||
llassert(object == AIThreadSafeBits<T>::ptr());
|
||||
#endif
|
||||
}
|
||||
|
||||
#if LL_DEBUG
|
||||
// Can only be locked when there still exists an AIAccess object that
|
||||
// references this object and will access it upon destruction.
|
||||
// If the assertion fails, make sure that such AIAccess object is
|
||||
// destructed before the deletion of this object.
|
||||
~AIThreadSafe() { llassert(!mRWLock.isLocked()); }
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -259,39 +194,48 @@ public:
|
||||
*
|
||||
* <code>
|
||||
* Foo foo(x, y);
|
||||
* static Bar bar(0.1, true);
|
||||
* static Bar bar;
|
||||
* </code>
|
||||
*
|
||||
* One can instantiate a thread-safe instance with
|
||||
*
|
||||
* <code>
|
||||
* AITHREADSAFE(Foo, foo, (x, y));
|
||||
* static AITHREADSAFE(Bar, bar, (0.1, true));
|
||||
* static AITHREADSAFE(Bar, bar, );
|
||||
* </code>
|
||||
*
|
||||
* Note: This macro does not allow to allocate such object on the heap.
|
||||
* If that is needed, have a look at AIThreadSafeDC.
|
||||
*/
|
||||
#if LL_WINDOWS
|
||||
template<typename T>
|
||||
AIThreadSafeWindowsHack<T>::AIThreadSafeWindowsHack(AIThreadSafeBits<T>& var, T* object)
|
||||
{
|
||||
llassert(object == var.ptr());
|
||||
}
|
||||
#define AITHREADSAFE(type, var, paramlist) \
|
||||
AIThreadSafe<type> var(NULL); \
|
||||
AIThreadSafeWindowsHack<type> dummy_##var(var, new (var.memory()) type paramlist)
|
||||
#else
|
||||
#define AITHREADSAFE(type, var, paramlist) AIThreadSafe<type> var(new (var.memory()) type paramlist)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief A wrapper class for objects that need to be accessed by more than one thread.
|
||||
*
|
||||
* This class is the same as an AIThreadSafe wrapper, except that it can only
|
||||
* be used for default constructed objects, or constructed with one parameter.
|
||||
* be used for default constructed objects.
|
||||
*
|
||||
* For example, instead of
|
||||
*
|
||||
* <code>
|
||||
* Foo foo;
|
||||
* Bar bar(3);
|
||||
* </code>
|
||||
*
|
||||
* One would use
|
||||
*
|
||||
* <code>
|
||||
* AIThreadSafeDC<Foo> foo;
|
||||
* AIThreadSafeDC<Bar> bar(3);
|
||||
* </code>
|
||||
*
|
||||
* The advantage over AITHREADSAFE is that this object can be allocated with
|
||||
@@ -309,8 +253,6 @@ class AIThreadSafeDC : public AIThreadSafe<T>
|
||||
public:
|
||||
// Construct a wrapper around a default constructed object.
|
||||
AIThreadSafeDC(void) { new (AIThreadSafe<T>::ptr()) T; }
|
||||
// Allow an arbitrary parameter to be passed for construction.
|
||||
template<typename T2> AIThreadSafeDC(T2 const& val) { new (AIThreadSafe<T>::ptr()) T(val); }
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -448,7 +390,6 @@ struct AIWriteAccess : public AIReadAccess<T>
|
||||
*
|
||||
* AIAccess<Foo> foo_w(foo);
|
||||
* // Use foo_w-> for read and write access.
|
||||
* </code>
|
||||
*
|
||||
* See also AIThreadSafe
|
||||
*/
|
||||
@@ -457,7 +398,6 @@ class AIThreadSafeSimple : public AIThreadSafeBits<T>
|
||||
{
|
||||
protected:
|
||||
// Only this one may access the object (through ptr()).
|
||||
friend struct AIAccessConst<T>;
|
||||
friend struct AIAccess<T>;
|
||||
|
||||
// Locking control.
|
||||
@@ -471,14 +411,6 @@ protected:
|
||||
public:
|
||||
// Only for use by AITHREADSAFESIMPLE, see below.
|
||||
AIThreadSafeSimple(T* object) { llassert(object == AIThreadSafeBits<T>::ptr()); }
|
||||
|
||||
#if LL_DEBUG
|
||||
// Can only be locked when there still exists an AIAccess object that
|
||||
// references this object and will access it upon destruction.
|
||||
// If the assertion fails, make sure that such AIAccess object is
|
||||
// destructed before the deletion of this object.
|
||||
~AIThreadSafeSimple() { llassert(!mMutex.isLocked()); }
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -488,14 +420,14 @@ public:
|
||||
*
|
||||
* <code>
|
||||
* Foo foo(x, y);
|
||||
* static Bar bar(0.1, true);
|
||||
* static Bar bar;
|
||||
* </code>
|
||||
*
|
||||
* One can instantiate a thread-safe instance with
|
||||
*
|
||||
* <code>
|
||||
* AITHREADSAFESIMPLE(Foo, foo, (x, y));
|
||||
* static AITHREADSAFESIMPLE(Bar, bar, (0.1, true));
|
||||
* static AITHREADSAFESIMPLE(Bar, bar, );
|
||||
* </code>
|
||||
*
|
||||
* Note: This macro does not allow to allocate such object on the heap.
|
||||
@@ -507,20 +439,18 @@ public:
|
||||
* @brief A wrapper class for objects that need to be accessed by more than one thread.
|
||||
*
|
||||
* This class is the same as an AIThreadSafeSimple wrapper, except that it can only
|
||||
* be used for default constructed objects, or constructed with one parameter.
|
||||
* be used for default constructed objects.
|
||||
*
|
||||
* For example, instead of
|
||||
*
|
||||
* <code>
|
||||
* Foo foo;
|
||||
* Bar bar(0.1);
|
||||
* </code>
|
||||
*
|
||||
* One would use
|
||||
*
|
||||
* <code>
|
||||
* AIThreadSafeSimpleDC<Foo> foo;
|
||||
* AIThreadSafeSimpleDC<Bar> bar(0.1);
|
||||
* </code>
|
||||
*
|
||||
* The advantage over AITHREADSAFESIMPLE is that this object can be allocated with
|
||||
@@ -538,12 +468,10 @@ class AIThreadSafeSimpleDC : public AIThreadSafeSimple<T>
|
||||
public:
|
||||
// Construct a wrapper around a default constructed object.
|
||||
AIThreadSafeSimpleDC(void) { new (AIThreadSafeSimple<T>::ptr()) T; }
|
||||
// Allow an arbitrary parameter to be passed for construction.
|
||||
template<typename T2> AIThreadSafeSimpleDC(T2 const& val) { new (AIThreadSafeSimple<T>::ptr()) T(val); }
|
||||
|
||||
protected:
|
||||
// For use by AIThreadSafeSimpleDCRootPool
|
||||
AIThreadSafeSimpleDC(LLAPRRootPool& parent) : AIThreadSafeSimple<T>(parent) { new (AIThreadSafeSimple<T>::ptr()) T; }
|
||||
AIThreadSafeSimpleDC(LLAPRPool& parent) : AIThreadSafeSimple<T>(parent) { new (AIThreadSafeSimple<T>::ptr()) T; }
|
||||
};
|
||||
|
||||
// Helper class for AIThreadSafeSimpleDCRootPool to assure initialization of
|
||||
@@ -565,7 +493,7 @@ private:
|
||||
* for the internally used mutexes and condition, instead of using the current threads
|
||||
* root pool. The advantage of this is that it can be used for objects that need to
|
||||
* be accessed from the destructors of global objects (after main). The disadvantage
|
||||
* is that it's less efficient to use your own root pool, therefore its use should be
|
||||
* is that it's less efficient to use your own root pool, therefore it's use should be
|
||||
* restricted to those cases where it is absolutely necessary.
|
||||
*/
|
||||
template<typename T>
|
||||
@@ -581,13 +509,13 @@ public:
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Write lock object and provide read access.
|
||||
* @brief Write lock object and provide read/write access.
|
||||
*/
|
||||
template<typename T>
|
||||
struct AIAccessConst
|
||||
struct AIAccess
|
||||
{
|
||||
//! Construct a AIAccessConst from a constant AIThreadSafeSimple.
|
||||
AIAccessConst(AIThreadSafeSimple<T> const& wrapper) : mWrapper(const_cast<AIThreadSafeSimple<T>&>(wrapper))
|
||||
//! Construct a AIAccess from a non-constant AIThreadSafeSimple.
|
||||
AIAccess(AIThreadSafeSimple<T>& wrapper) : mWrapper(wrapper)
|
||||
#if AI_NEED_ACCESS_CC
|
||||
, mIsCopyConstructed(false)
|
||||
#endif
|
||||
@@ -596,12 +524,12 @@ struct AIAccessConst
|
||||
}
|
||||
|
||||
//! Access the underlaying object for (read and) write access.
|
||||
T const* operator->() const { return this->mWrapper.ptr(); }
|
||||
T* operator->() const { return this->mWrapper.ptr(); }
|
||||
|
||||
//! Access the underlaying object for (read and) write access.
|
||||
T const& operator*() const { return *this->mWrapper.ptr(); }
|
||||
T& operator*() const { return *this->mWrapper.ptr(); }
|
||||
|
||||
~AIAccessConst()
|
||||
~AIAccess()
|
||||
{
|
||||
#if AI_NEED_ACCESS_CC
|
||||
if (mIsCopyConstructed) return;
|
||||
@@ -610,229 +538,17 @@ struct AIAccessConst
|
||||
}
|
||||
|
||||
protected:
|
||||
AIThreadSafeSimple<T>& mWrapper; //!< Reference to the object that we provide access to.
|
||||
AIThreadSafeSimple<T>& mWrapper; //!< Reference to the object that we provide access to.
|
||||
|
||||
#if AI_NEED_ACCESS_CC
|
||||
bool mIsCopyConstructed;
|
||||
public:
|
||||
AIAccessConst(AIAccessConst const& orig) : mWrapper(orig.mWrapper), mIsCopyConstructed(true) { }
|
||||
AIAccess(AIAccess const& orig) : mWrapper(orig.mWrapper), mIsCopyConstructed(true) { }
|
||||
#else
|
||||
private:
|
||||
// Disallow copy constructing directly.
|
||||
AIAccessConst(AIAccessConst const&);
|
||||
AIAccess(AIAccess const&);
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Write lock object and provide read/write access.
|
||||
*/
|
||||
template<typename T>
|
||||
struct AIAccess : public AIAccessConst<T>
|
||||
{
|
||||
//! Construct a AIAccess from a non-constant AIThreadSafeSimple.
|
||||
AIAccess(AIThreadSafeSimple<T>& wrapper) : AIAccessConst<T>(wrapper) { }
|
||||
|
||||
//! Access the underlaying object for (read and) write access.
|
||||
T* operator->() const { return this->mWrapper.ptr(); }
|
||||
|
||||
//! Access the underlaying object for (read and) write access.
|
||||
T& operator*() const { return *this->mWrapper.ptr(); }
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief A wrapper class for objects that should only be accessed by a single thread.
|
||||
*
|
||||
* Use AITHREADSAFESINGLETHREAD to define instances of any type, and use AISTAccess
|
||||
* to get access to the instance.
|
||||
*
|
||||
* For example,
|
||||
*
|
||||
* <code>
|
||||
* class Foo { public: Foo(int, int); };
|
||||
*
|
||||
* AITHREADSAFESINGLETHREAD(Foo, foo, (2, 3));
|
||||
*
|
||||
* AISTAccess<Foo> foo_w(foo);
|
||||
* // Use foo_w-> for read and write access.
|
||||
* </code>
|
||||
*/
|
||||
template<typename T>
|
||||
class AIThreadSafeSingleThread : public AIThreadSafeBits<T>
|
||||
{
|
||||
protected:
|
||||
// Only these one may access the object (through ptr()).
|
||||
friend struct AISTAccessConst<T>;
|
||||
friend struct AISTAccess<T>;
|
||||
|
||||
// For use by AIThreadSafeSingleThreadDC.
|
||||
AIThreadSafeSingleThread(void)
|
||||
#ifdef LL_DEBUG
|
||||
: mAccessed(false)
|
||||
#endif
|
||||
{ }
|
||||
|
||||
#ifdef LL_DEBUG
|
||||
mutable bool mAccessed;
|
||||
mutable apr_os_thread_t mTheadID;
|
||||
|
||||
void accessed(void) const
|
||||
{
|
||||
if (!mAccessed)
|
||||
{
|
||||
mAccessed = true;
|
||||
mTheadID = apr_os_thread_current();
|
||||
}
|
||||
else
|
||||
{
|
||||
llassert_always(apr_os_thread_equal(mTheadID, apr_os_thread_current()));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
public:
|
||||
// Only for use by AITHREADSAFESINGLETHREAD, see below.
|
||||
AIThreadSafeSingleThread(T* object)
|
||||
#ifdef LL_DEBUG
|
||||
: mAccessed(false)
|
||||
#endif
|
||||
{
|
||||
llassert(object == AIThreadSafeBits<T>::ptr());
|
||||
}
|
||||
|
||||
private:
|
||||
// Disallow copying or assignments.
|
||||
AIThreadSafeSingleThread(AIThreadSafeSingleThread const&);
|
||||
void operator=(AIThreadSafeSingleThread const&);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief A wrapper class for objects that should only be accessed by a single thread.
|
||||
*
|
||||
* This class is the same as an AIThreadSafeSingleThread wrapper, except that it can only
|
||||
* be used for default constructed objects, or constructed with one parameter.
|
||||
*
|
||||
* For example, instead of
|
||||
*
|
||||
* <code>
|
||||
* Foo foo;
|
||||
* Bar bar(0.1);
|
||||
* </code>
|
||||
*
|
||||
* One would use
|
||||
*
|
||||
* <code>
|
||||
* AIThreadSafeSingleThreadDC<Foo> foo;
|
||||
* AIThreadSafeSingleThreadDC<Bar> bar(0.1);
|
||||
* </code>
|
||||
*
|
||||
* The advantage over AITHREADSAFESINGLETHREAD is that this object can be allocated with
|
||||
* new on the heap. For example:
|
||||
*
|
||||
* <code>
|
||||
* AIThreadSafeSingleThreadDC<Foo>* ptr = new AIThreadSafeSingleThreadDC<Foo>;
|
||||
* </code>
|
||||
*
|
||||
* which is not possible with AITHREADSAFESINGLETHREAD.
|
||||
*
|
||||
* This class is primarily intended to test if some (member) variable needs locking,
|
||||
* during development (in debug mode), and is therefore more flexible in that it
|
||||
* automatically converts to the underlying type, can be assigned to and can be
|
||||
* written to an ostream, as if it wasn't wrapped at all. This is to reduce the
|
||||
* impact on the source code.
|
||||
*/
|
||||
template<typename T>
|
||||
class AIThreadSafeSingleThreadDC : public AIThreadSafeSingleThread<T>
|
||||
{
|
||||
public:
|
||||
// Construct a wrapper around a default constructed object.
|
||||
AIThreadSafeSingleThreadDC(void) { new (AIThreadSafeSingleThread<T>::ptr()) T; }
|
||||
// Allow an arbitrary parameter to be passed for construction.
|
||||
template<typename T2> AIThreadSafeSingleThreadDC(T2 const& val) { new (AIThreadSafeSingleThread<T>::ptr()) T(val); }
|
||||
|
||||
// Allow assigning with T.
|
||||
AIThreadSafeSingleThreadDC& operator=(T const& val) { AIThreadSafeSingleThread<T>::accessed(); *AIThreadSafeSingleThread<T>::ptr() = val; return *this; }
|
||||
// Allow writing to an ostream.
|
||||
friend std::ostream& operator<<(std::ostream& os, AIThreadSafeSingleThreadDC const& wrapped_val) { wrapped_val.accessed(); return os << *wrapped_val.ptr(); }
|
||||
|
||||
// Automatic conversion to T.
|
||||
operator T&(void) { AIThreadSafeSingleThread<T>::accessed(); return *AIThreadSafeSingleThread<T>::ptr(); }
|
||||
operator T const&(void) const { AIThreadSafeSingleThread<T>::accessed(); return *AIThreadSafeSingleThread<T>::ptr(); }
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Instantiate a static, global or local object of a given type wrapped in AIThreadSafeSingleThread, using an arbitrary constructor.
|
||||
*
|
||||
* For example, instead of doing
|
||||
*
|
||||
* <code>
|
||||
* Foo foo(x, y);
|
||||
* static Bar bar;
|
||||
* </code>
|
||||
*
|
||||
* One can instantiate a thread-safe instance with
|
||||
*
|
||||
* <code>
|
||||
* AITHREADSAFESINGLETHREAD(Foo, foo, (x, y));
|
||||
* static AITHREADSAFESINGLETHREAD(Bar, bar, );
|
||||
* </code>
|
||||
*
|
||||
* Note: This macro does not allow to allocate such object on the heap.
|
||||
* If that is needed, have a look at AIThreadSafeSingleThreadDC.
|
||||
*/
|
||||
#define AITHREADSAFESINGLETHREAD(type, var, paramlist) AIThreadSafeSingleThread<type> var(new (var.memory()) type paramlist)
|
||||
|
||||
/**
|
||||
* @brief Access single threaded object for read access.
|
||||
*/
|
||||
template<typename T>
|
||||
struct AISTAccessConst
|
||||
{
|
||||
//! Construct a AISTAccessConst from a constant AIThreadSafeSingleThread.
|
||||
AISTAccessConst(AIThreadSafeSingleThread<T> const& wrapper) : mWrapper(const_cast<AIThreadSafeSingleThread<T>&>(wrapper))
|
||||
{
|
||||
#if LL_DEBUG
|
||||
wrapper.accessed();
|
||||
#endif
|
||||
}
|
||||
|
||||
//! Access the underlaying object for read access.
|
||||
T const* operator->() const { return this->mWrapper.ptr(); }
|
||||
|
||||
//! Access the underlaying object for read write access.
|
||||
T const& operator*() const { return *this->mWrapper.ptr(); }
|
||||
|
||||
protected:
|
||||
AIThreadSafeSingleThread<T>& mWrapper; //!< Reference to the object that we provide access to.
|
||||
|
||||
#if AI_NEED_ACCESS_CC
|
||||
public:
|
||||
AISTAccessConst(AISTAccessConst const& orig) : mWrapper(orig.mWrapper) { }
|
||||
#else
|
||||
private:
|
||||
// Disallow copy constructing directly.
|
||||
AISTAccessConst(AISTAccessConst const&);
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Access single threaded object for read/write access.
|
||||
*/
|
||||
template<typename T>
|
||||
struct AISTAccess : public AISTAccessConst<T>
|
||||
{
|
||||
//! Construct a AISTAccess from a non-constant AIThreadSafeSingleThread.
|
||||
AISTAccess(AIThreadSafeSingleThread<T>& wrapper) : AISTAccessConst<T>(wrapper)
|
||||
{
|
||||
#if LL_DEBUG
|
||||
wrapper.accessed();
|
||||
#endif
|
||||
}
|
||||
|
||||
//! Access the underlaying object for (read and) write access.
|
||||
T* operator->() const { return this->mWrapper.ptr(); }
|
||||
|
||||
//! Access the underlaying object for (read and) write access.
|
||||
T& operator*() const { return *this->mWrapper.ptr(); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
|
||||
// NOTE: This next two funtions are only included here
|
||||
// for those too familiar with the LLLinkedList template class.
|
||||
// They are deprecated. resetList() is unecessary while
|
||||
// They are depreciated. resetList() is unecessary while
|
||||
// getCurrentData() is identical to getNextData() and has
|
||||
// a misleading name.
|
||||
//
|
||||
@@ -604,7 +604,7 @@ BOOL LLDoubleLinkedList<DATA_TYPE>::checkData(const DATA_TYPE *data)
|
||||
|
||||
// NOTE: This next two funtions are only included here
|
||||
// for those too familiar with the LLLinkedList template class.
|
||||
// They are deprecated. resetList() is unecessary while
|
||||
// They are depreciated. resetList() is unecessary while
|
||||
// getCurrentData() is identical to getNextData() and has
|
||||
// a misleading name.
|
||||
//
|
||||
|
||||
@@ -153,6 +153,11 @@ const char LAND_LAYER_CODE = 'L';
|
||||
const char WATER_LAYER_CODE = 'W';
|
||||
const char WIND_LAYER_CODE = '7';
|
||||
const char CLOUD_LAYER_CODE = '8';
|
||||
// Extended land layer for Aurora Sim
|
||||
const char AURORA_LAND_LAYER_CODE = 'M';
|
||||
const char AURORA_WATER_LAYER_CODE = 'X';
|
||||
const char AURORA_WIND_LAYER_CODE = '9';
|
||||
const char AURORA_CLOUD_LAYER_CODE = ':';
|
||||
|
||||
// keys
|
||||
// Bit masks for various keyboard modifier keys.
|
||||
@@ -375,7 +380,7 @@ const U32 PARCEL_MEDIA_COMMAND_LOOP_SET = 13;
|
||||
const U32 MAP_ITEM_TELEHUB = 0x01;
|
||||
const U32 MAP_ITEM_PG_EVENT = 0x02;
|
||||
const U32 MAP_ITEM_MATURE_EVENT = 0x03;
|
||||
//const U32 MAP_ITEM_POPULAR = 0x04; // No longer supported, 2009-03-02 KLW
|
||||
const U32 MAP_ITEM_POPULAR = 0x04;
|
||||
//const U32 MAP_ITEM_AGENT_COUNT = 0x05;
|
||||
const U32 MAP_ITEM_AGENT_LOCATIONS = 0x06;
|
||||
const U32 MAP_ITEM_LAND_FOR_SALE = 0x07;
|
||||
|
||||
@@ -1,177 +0,0 @@
|
||||
/**
|
||||
* @file ll_template_cast.h
|
||||
* @author Nat Goodspeed
|
||||
* @date 2009-11-21
|
||||
* @brief Define ll_template_cast function
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* 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;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#if ! defined(LL_LL_TEMPLATE_CAST_H)
|
||||
#define LL_LL_TEMPLATE_CAST_H
|
||||
|
||||
/**
|
||||
* Implementation for ll_template_cast() (q.v.).
|
||||
*
|
||||
* Default implementation: trying to cast two completely unrelated types
|
||||
* returns 0. Typically you'd specify T and U as pointer types, but in fact T
|
||||
* can be any type that can be initialized with 0.
|
||||
*/
|
||||
template <typename T, typename U>
|
||||
struct ll_template_cast_impl
|
||||
{
|
||||
T operator()(U)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* ll_template_cast<T>(some_value) is for use in a template function when
|
||||
* some_value might be of arbitrary type, but you want to recognize type T
|
||||
* specially.
|
||||
*
|
||||
* It's designed for use with pointer types. Example:
|
||||
* @code
|
||||
* struct SpecialClass
|
||||
* {
|
||||
* void someMethod(const std::string&) const;
|
||||
* };
|
||||
*
|
||||
* template <class REALCLASS>
|
||||
* void somefunc(const REALCLASS& instance)
|
||||
* {
|
||||
* const SpecialClass* ptr = ll_template_cast<const SpecialClass*>(&instance);
|
||||
* if (ptr)
|
||||
* {
|
||||
* ptr->someMethod("Call method only available on SpecialClass");
|
||||
* }
|
||||
* }
|
||||
* @endcode
|
||||
*
|
||||
* Why is this better than dynamic_cast<>? Because unless OtherClass is
|
||||
* polymorphic, the following won't even compile (gcc 4.0.1):
|
||||
* @code
|
||||
* OtherClass other;
|
||||
* SpecialClass* ptr = dynamic_cast<SpecialClass*>(&other);
|
||||
* @endcode
|
||||
* to say nothing of this:
|
||||
* @code
|
||||
* void function(int);
|
||||
* SpecialClass* ptr = dynamic_cast<SpecialClass*>(&function);
|
||||
* @endcode
|
||||
* ll_template_cast handles these kinds of cases by returning 0.
|
||||
*/
|
||||
template <typename T, typename U>
|
||||
T ll_template_cast(U value)
|
||||
{
|
||||
return ll_template_cast_impl<T, U>()(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation for ll_template_cast() (q.v.).
|
||||
*
|
||||
* Implementation for identical types: return same value.
|
||||
*/
|
||||
template <typename T>
|
||||
struct ll_template_cast_impl<T, T>
|
||||
{
|
||||
T operator()(T value)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* LL_TEMPLATE_CONVERTIBLE(dest, source) asserts that, for a value @c s of
|
||||
* type @c source, <tt>ll_template_cast<dest>(s)</tt> will return @c s --
|
||||
* presuming that @c source can be converted to @c dest by the normal rules of
|
||||
* C++.
|
||||
*
|
||||
* By default, <tt>ll_template_cast<dest>(s)</tt> will return 0 unless @c s's
|
||||
* type is literally identical to @c dest. (This is because of the
|
||||
* straightforward application of template specialization rules.) That can
|
||||
* lead to surprising results, e.g.:
|
||||
*
|
||||
* @code
|
||||
* Foo myFoo;
|
||||
* const Foo* fooptr = ll_template_cast<const Foo*>(&myFoo);
|
||||
* @endcode
|
||||
*
|
||||
* Here @c fooptr will be 0 because <tt>&myFoo</tt> is of type <tt>Foo*</tt>
|
||||
* -- @em not <tt>const Foo*</tt>. (Declaring <tt>const Foo myFoo;</tt> would
|
||||
* force the compiler to do the right thing.)
|
||||
*
|
||||
* More disappointingly:
|
||||
* @code
|
||||
* struct Base {};
|
||||
* struct Subclass: public Base {};
|
||||
* Subclass object;
|
||||
* Base* ptr = ll_template_cast<Base*>(&object);
|
||||
* @endcode
|
||||
*
|
||||
* Here @c ptr will be 0 because <tt>&object</tt> is of type
|
||||
* <tt>Subclass*</tt> rather than <tt>Base*</tt>. We @em want this cast to
|
||||
* succeed, but without our help ll_template_cast can't recognize it.
|
||||
*
|
||||
* The following would suffice:
|
||||
* @code
|
||||
* LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*);
|
||||
* ...
|
||||
* Base* ptr = ll_template_cast<Base*>(&object);
|
||||
* @endcode
|
||||
*
|
||||
* However, as noted earlier, this is easily fooled:
|
||||
* @code
|
||||
* const Base* ptr = ll_template_cast<const Base*>(&object);
|
||||
* @endcode
|
||||
* would still produce 0 because we haven't yet seen:
|
||||
* @code
|
||||
* LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*);
|
||||
* @endcode
|
||||
*
|
||||
* @TODO
|
||||
* This macro should use Boost type_traits facilities for stripping and
|
||||
* re-adding @c const and @c volatile qualifiers so that invoking
|
||||
* LL_TEMPLATE_CONVERTIBLE(dest, source) will automatically generate all
|
||||
* permitted permutations. It's really not fair to the coder to require
|
||||
* separate:
|
||||
* @code
|
||||
* LL_TEMPLATE_CONVERTIBLE(Base*, Subclass*);
|
||||
* LL_TEMPLATE_CONVERTIBLE(const Base*, Subclass*);
|
||||
* LL_TEMPLATE_CONVERTIBLE(const Base*, const Subclass*);
|
||||
* @endcode
|
||||
*
|
||||
* (Naturally we omit <tt>LL_TEMPLATE_CONVERTIBLE(Base*, const Subclass*)</tt>
|
||||
* because that's not permitted by normal C++ assignment anyway.)
|
||||
*/
|
||||
#define LL_TEMPLATE_CONVERTIBLE(DEST, SOURCE) \
|
||||
template <> \
|
||||
struct ll_template_cast_impl<DEST, SOURCE> \
|
||||
{ \
|
||||
DEST operator()(SOURCE wrapper) \
|
||||
{ \
|
||||
return wrapper; \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif /* ! defined(LL_LL_TEMPLATE_CAST_H) */
|
||||
@@ -1,134 +0,0 @@
|
||||
/**
|
||||
* @file llallocator.cpp
|
||||
* @brief Implementation of the LLAllocator class.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* 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;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "llallocator.h"
|
||||
|
||||
#if LL_USE_TCMALLOC
|
||||
|
||||
#include "google/heap-profiler.h"
|
||||
#include "google/commandlineflags_public.h"
|
||||
|
||||
DECLARE_bool(heap_profile_use_stack_trace);
|
||||
//DECLARE_double(tcmalloc_release_rate);
|
||||
|
||||
// static
|
||||
void LLAllocator::pushMemType(S32 type)
|
||||
{
|
||||
if(isProfiling())
|
||||
{
|
||||
PushMemType(type);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
S32 LLAllocator::popMemType()
|
||||
{
|
||||
if (isProfiling())
|
||||
{
|
||||
return PopMemType();
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
void LLAllocator::setProfilingEnabled(bool should_enable)
|
||||
{
|
||||
// NULL disables dumping to disk
|
||||
static char const * const PREFIX = NULL;
|
||||
if(should_enable)
|
||||
{
|
||||
HeapProfilerSetUseStackTrace(false);
|
||||
HeapProfilerStart(PREFIX);
|
||||
}
|
||||
else
|
||||
{
|
||||
HeapProfilerStop();
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLAllocator::isProfiling()
|
||||
{
|
||||
return IsHeapProfilerRunning();
|
||||
}
|
||||
|
||||
std::string LLAllocator::getRawProfile()
|
||||
{
|
||||
// *TODO - fix google-perftools to accept an buffer to avoid this
|
||||
// malloc-copy-free cycle.
|
||||
char * buffer = GetHeapProfile();
|
||||
std::string ret = buffer;
|
||||
free(buffer);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#else // LL_USE_TCMALLOC
|
||||
|
||||
//
|
||||
// stub implementations for when tcmalloc is disabled
|
||||
//
|
||||
|
||||
// static
|
||||
void LLAllocator::pushMemType(S32 type)
|
||||
{
|
||||
}
|
||||
|
||||
// static
|
||||
S32 LLAllocator::popMemType()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
void LLAllocator::setProfilingEnabled(bool should_enable)
|
||||
{
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLAllocator::isProfiling()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string LLAllocator::getRawProfile()
|
||||
{
|
||||
return std::string();
|
||||
}
|
||||
|
||||
#endif // LL_USE_TCMALLOC
|
||||
|
||||
LLAllocatorHeapProfile const & LLAllocator::getProfile()
|
||||
{
|
||||
mProf.mLines.clear();
|
||||
|
||||
// *TODO - avoid making all these extra copies of things...
|
||||
std::string prof_text = getRawProfile();
|
||||
//std::cout << prof_text << std::endl;
|
||||
mProf.parse(prof_text);
|
||||
return mProf;
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
/**
|
||||
* @file llallocator.h
|
||||
* @brief Declaration of the LLAllocator class.
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* 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;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLALLOCATOR_H
|
||||
#define LL_LLALLOCATOR_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "llmemtype.h"
|
||||
#include "llallocator_heap_profile.h"
|
||||
|
||||
class LL_COMMON_API LLAllocator {
|
||||
friend class LLMemoryView;
|
||||
friend class LLMemType;
|
||||
|
||||
private:
|
||||
static void pushMemType(S32 type);
|
||||
static S32 popMemType();
|
||||
|
||||
public:
|
||||
void setProfilingEnabled(bool should_enable);
|
||||
|
||||
static bool isProfiling();
|
||||
|
||||
LLAllocatorHeapProfile const & getProfile();
|
||||
|
||||
private:
|
||||
std::string getRawProfile();
|
||||
|
||||
private:
|
||||
LLAllocatorHeapProfile mProf;
|
||||
};
|
||||
|
||||
#endif // LL_LLALLOCATOR_H
|
||||
@@ -1,147 +0,0 @@
|
||||
/**
|
||||
* @file llallocator_heap_profile.cpp
|
||||
* @brief Implementation of the parser for tcmalloc heap profile data.
|
||||
* @author Brad Kittenbrink
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* 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;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "linden_common.h"
|
||||
#include "llallocator_heap_profile.h"
|
||||
|
||||
#if LL_MSVC
|
||||
// disable warning about boost::lexical_cast returning uninitialized data
|
||||
// when it fails to parse the string
|
||||
#pragma warning (disable:4701)
|
||||
#pragma warning (disable:4702)
|
||||
#endif
|
||||
|
||||
#include <boost/algorithm/string/split.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/range/iterator_range.hpp>
|
||||
|
||||
static const std::string HEAP_PROFILE_MAGIC_STR = "heap profile:";
|
||||
|
||||
static bool is_separator(char c)
|
||||
{
|
||||
return isspace(c) || c == '[' || c == ']' || c == ':';
|
||||
}
|
||||
|
||||
void LLAllocatorHeapProfile::parse(std::string const & prof_text)
|
||||
{
|
||||
// a typedef for handling a token in the string buffer
|
||||
// it's a begin/end pair of string::const_iterators
|
||||
typedef boost::iterator_range<std::string::const_iterator> range_t;
|
||||
|
||||
mLines.clear();
|
||||
|
||||
if(prof_text.compare(0, HEAP_PROFILE_MAGIC_STR.length(), HEAP_PROFILE_MAGIC_STR) != 0)
|
||||
{
|
||||
// *TODO - determine if there should be some better error state than
|
||||
// mLines being empty. -brad
|
||||
llwarns << "invalid heap profile data passed into parser." << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector< range_t > prof_lines;
|
||||
|
||||
std::string::const_iterator prof_begin = prof_text.begin() + HEAP_PROFILE_MAGIC_STR.length();
|
||||
|
||||
range_t prof_range(prof_begin, prof_text.end());
|
||||
boost::algorithm::split(prof_lines,
|
||||
prof_range,
|
||||
boost::bind(std::equal_to<llwchar>(), '\n', _1));
|
||||
|
||||
std::vector< range_t >::const_iterator i;
|
||||
for(i = prof_lines.begin(); i != prof_lines.end() && !i->empty(); ++i)
|
||||
{
|
||||
range_t const & line_text = *i;
|
||||
|
||||
std::vector<range_t> line_elems;
|
||||
|
||||
boost::algorithm::split(line_elems,
|
||||
line_text,
|
||||
is_separator);
|
||||
|
||||
std::vector< range_t >::iterator j;
|
||||
j = line_elems.begin();
|
||||
|
||||
while(j != line_elems.end() && j->empty()) { ++j; } // skip any separator tokens
|
||||
llassert_always(j != line_elems.end());
|
||||
U32 live_count = boost::lexical_cast<U32>(*j);
|
||||
++j;
|
||||
|
||||
while(j != line_elems.end() && j->empty()) { ++j; } // skip any separator tokens
|
||||
llassert_always(j != line_elems.end());
|
||||
U64 live_size = boost::lexical_cast<U64>(*j);
|
||||
++j;
|
||||
|
||||
while(j != line_elems.end() && j->empty()) { ++j; } // skip any separator tokens
|
||||
llassert_always(j != line_elems.end());
|
||||
U32 tot_count = boost::lexical_cast<U32>(*j);
|
||||
++j;
|
||||
|
||||
while(j != line_elems.end() && j->empty()) { ++j; } // skip any separator tokens
|
||||
llassert_always(j != line_elems.end());
|
||||
U64 tot_size = boost::lexical_cast<U64>(*j);
|
||||
++j;
|
||||
|
||||
while(j != line_elems.end() && j->empty()) { ++j; } // skip any separator tokens
|
||||
llassert(j != line_elems.end());
|
||||
if (j != line_elems.end())
|
||||
{
|
||||
++j; // skip the '@'
|
||||
|
||||
mLines.push_back(line(live_count, live_size, tot_count, tot_size));
|
||||
line & current_line = mLines.back();
|
||||
|
||||
for(; j != line_elems.end(); ++j)
|
||||
{
|
||||
if(!j->empty())
|
||||
{
|
||||
U32 marker = boost::lexical_cast<U32>(*j);
|
||||
current_line.mTrace.push_back(marker);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// *TODO - parse MAPPED_LIBRARIES section here if we're ever interested in it
|
||||
}
|
||||
|
||||
void LLAllocatorHeapProfile::dump(std::ostream & out) const
|
||||
{
|
||||
lines_t::const_iterator i;
|
||||
for(i = mLines.begin(); i != mLines.end(); ++i)
|
||||
{
|
||||
out << i->mLiveCount << ": " << i->mLiveSize << '[' << i->mTotalCount << ": " << i->mTotalSize << "] @";
|
||||
|
||||
stack_trace::const_iterator j;
|
||||
for(j = i->mTrace.begin(); j != i->mTrace.end(); ++j)
|
||||
{
|
||||
out << ' ' << *j;
|
||||
}
|
||||
out << '\n';
|
||||
}
|
||||
out.flush();
|
||||
}
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
/**
|
||||
* @file llallocator_heap_profile.h
|
||||
* @brief Declaration of the parser for tcmalloc heap profile data.
|
||||
* @author Brad Kittenbrink
|
||||
*
|
||||
* $LicenseInfo:firstyear=2009&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2010, Linden Research, Inc.
|
||||
*
|
||||
* 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;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLALLOCATOR_HEAP_PROFILE_H
|
||||
#define LL_LLALLOCATOR_HEAP_PROFILE_H
|
||||
|
||||
#include "stdtypes.h"
|
||||
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
class LLAllocatorHeapProfile
|
||||
{
|
||||
public:
|
||||
typedef int stack_marker;
|
||||
|
||||
typedef std::vector<stack_marker> stack_trace;
|
||||
|
||||
struct line {
|
||||
line(U32 live_count, U64 live_size, U32 tot_count, U64 tot_size) :
|
||||
mLiveSize(live_size),
|
||||
mTotalSize(tot_size),
|
||||
mLiveCount(live_count),
|
||||
mTotalCount(tot_count)
|
||||
{
|
||||
}
|
||||
U64 mLiveSize, mTotalSize;
|
||||
U32 mLiveCount, mTotalCount;
|
||||
stack_trace mTrace;
|
||||
};
|
||||
|
||||
typedef std::vector<line> lines_t;
|
||||
|
||||
LLAllocatorHeapProfile()
|
||||
{
|
||||
}
|
||||
|
||||
void parse(std::string const & prof_text);
|
||||
|
||||
void dump(std::ostream & out) const;
|
||||
|
||||
public:
|
||||
lines_t mLines;
|
||||
};
|
||||
|
||||
|
||||
#endif // LL_LLALLOCATOR_HEAP_PROFILE_H
|
||||
@@ -74,7 +74,7 @@ S32 LL_HEARTBEAT_SIGNAL = (SIGRTMAX >= 0) ? (SIGRTMAX-0) : SIGUSR2;
|
||||
// the static application instance
|
||||
LLApp* LLApp::sApplication = NULL;
|
||||
|
||||
// Allows the generation of core files for post mortem under gdb
|
||||
// Allows the generation of core files for post mortum under gdb
|
||||
// and disables crashlogger
|
||||
BOOL LLApp::sDisableCrashlogger = FALSE;
|
||||
|
||||
@@ -297,20 +297,6 @@ void LLApp::startErrorThread()
|
||||
}
|
||||
}
|
||||
|
||||
void LLApp::stopErrorThread()
|
||||
{
|
||||
LLApp::setStopped(); // Signal error thread that we stopped.
|
||||
int count = 0;
|
||||
while (mThreadErrorp && !mThreadErrorp->isStopped() && ++count < 100)
|
||||
{
|
||||
ms_sleep(10);
|
||||
}
|
||||
if (mThreadErrorp && !mThreadErrorp->isStopped())
|
||||
{
|
||||
llwarns << "Failed to stop Error Thread." << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
void LLApp::setErrorHandler(LLAppErrorHandler handler)
|
||||
{
|
||||
LLApp::sErrorHandler = handler;
|
||||
@@ -410,24 +396,11 @@ bool LLApp::isQuitting()
|
||||
return (APP_STATUS_QUITTING == sStatus);
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLApp::isExiting()
|
||||
{
|
||||
return isQuitting() || isError();
|
||||
}
|
||||
|
||||
void LLApp::disableCrashlogger()
|
||||
{
|
||||
// Disable Breakpad exception handler.
|
||||
sDisableCrashlogger = TRUE;
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLApp::isCrashloggerDisabled()
|
||||
{
|
||||
return (sDisableCrashlogger == TRUE);
|
||||
}
|
||||
|
||||
#if !LL_WINDOWS
|
||||
// static
|
||||
U32 LLApp::getSigChildCount()
|
||||
@@ -761,7 +734,7 @@ void default_unix_signal_handler(int signum, siginfo_t *info, void *)
|
||||
llwarns << "Signal handler - Flagging error status and waiting for shutdown" << llendl;
|
||||
}
|
||||
|
||||
if (LLApp::isCrashloggerDisabled()) // Don't gracefully handle any signal, crash and core for a gdb post mortem
|
||||
if(LLApp::sDisableCrashlogger) //Don't gracefully handle any signals crash and core for a gdb post mortum
|
||||
{
|
||||
clear_signals();
|
||||
llwarns << "Fatal signal received, not handling the crash here, passing back to operating system" << llendl;
|
||||
|
||||
@@ -43,14 +43,10 @@ template <typename Type> class LLAtomic32;
|
||||
typedef LLAtomic32<U32> LLAtomicU32;
|
||||
class LLErrorThread;
|
||||
class LLLiveFile;
|
||||
|
||||
|
||||
#if LL_LINUX
|
||||
#include <signal.h>
|
||||
//typedef struct siginfo siginfo_t; //Removed as per changes in glibc 2.16 - Drake Arconis
|
||||
typedef struct siginfo siginfo_t;
|
||||
#endif
|
||||
|
||||
|
||||
typedef void (*LLAppErrorHandler)();
|
||||
typedef void (*LLAppChildCallback)(int pid, bool exited, int status);
|
||||
|
||||
@@ -195,11 +191,6 @@ public:
|
||||
//
|
||||
virtual bool mainLoop() = 0; // Override for the application main loop. Needs to at least gracefully notice the QUITTING state and exit.
|
||||
|
||||
//
|
||||
// Crash logging
|
||||
//
|
||||
void disableCrashlogger(); // Let the OS handle the crashes
|
||||
static bool isCrashloggerDisabled(); // Get the here above set value
|
||||
|
||||
//
|
||||
// Application status
|
||||
@@ -223,6 +214,9 @@ public:
|
||||
//
|
||||
void setErrorHandler(LLAppErrorHandler handler);
|
||||
void setSyncErrorHandler(LLAppErrorHandler handler);
|
||||
|
||||
static BOOL sDisableCrashlogger; // Let the OS handle crashes for us.
|
||||
|
||||
#if !LL_WINDOWS
|
||||
//
|
||||
// Child process handling (Unix only for now)
|
||||
@@ -251,7 +245,6 @@ protected:
|
||||
static void setStatus(EAppStatus status); // Use this to change the application status.
|
||||
static EAppStatus sStatus; // Reflects current application status
|
||||
static BOOL sErrorThreadRunning; // Set while the error thread is running
|
||||
static BOOL sDisableCrashlogger; // Let the OS handle crashes for us.
|
||||
|
||||
#if !LL_WINDOWS
|
||||
static LLAtomicU32* sSigChildCount; // Number of SIGCHLDs received.
|
||||
@@ -264,10 +257,6 @@ protected:
|
||||
* @ brief This method is called once as soon as logging is initialized.
|
||||
*/
|
||||
void startErrorThread();
|
||||
/**
|
||||
* @brief This method is called at the end, just prior to deinitializing curl.
|
||||
*/
|
||||
void stopErrorThread();
|
||||
|
||||
private:
|
||||
void setupErrorHandling(); // Do platform-specific error-handling setup (signals, structured exceptions)
|
||||
|
||||
@@ -88,7 +88,7 @@ bool ll_apr_warn_status(apr_status_t status)
|
||||
|
||||
void ll_apr_assert_status(apr_status_t status)
|
||||
{
|
||||
llassert(!ll_apr_warn_status(status));
|
||||
llassert(ll_apr_warn_status(status) == false);
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
@@ -146,7 +146,7 @@ apr_status_t LLAPRFile::open(std::string const& filename, apr_int32_t flags, acc
|
||||
|
||||
apr_status_t status;
|
||||
{
|
||||
apr_pool_t* apr_file_open_pool; // The use of apr_pool_t is OK here.
|
||||
apr_pool_t* apr_file_open_pool;
|
||||
// This is a temporary variable for a pool that is passed directly to apr_file_open below.
|
||||
if (access_type == short_lived)
|
||||
{
|
||||
@@ -199,6 +199,7 @@ apr_status_t LLAPRFile::open(const std::string& filename, apr_int32_t flags, BOO
|
||||
// File I/O
|
||||
S32 LLAPRFile::read(void *buf, S32 nbytes)
|
||||
{
|
||||
//llassert_always(mFile); (ASC-TUDCC) -HgB
|
||||
if(!mFile)
|
||||
{
|
||||
llwarns << "apr mFile is removed by somebody else. Can not read." << llendl ;
|
||||
@@ -221,6 +222,7 @@ S32 LLAPRFile::read(void *buf, S32 nbytes)
|
||||
|
||||
S32 LLAPRFile::write(const void *buf, S32 nbytes)
|
||||
{
|
||||
// llassert_always(mFile); (ASC-TUDCC) -HgB
|
||||
if(!mFile)
|
||||
{
|
||||
llwarns << "apr mFile is removed by somebody else. Can not write." << llendl ;
|
||||
@@ -247,7 +249,7 @@ S32 LLAPRFile::seek(apr_seek_where_t where, S32 offset)
|
||||
}
|
||||
|
||||
//
|
||||
// *******************************************************************************************************************************
|
||||
//*******************************************************************************************************************************
|
||||
//static components of LLAPRFile
|
||||
//
|
||||
|
||||
@@ -502,5 +504,5 @@ bool LLAPRFile::removeDir(const std::string& dirname)
|
||||
}
|
||||
//
|
||||
//end of static components of LLAPRFile
|
||||
// *******************************************************************************************************************************
|
||||
//*******************************************************************************************************************************
|
||||
//
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user