aboutsummaryrefslogtreecommitdiff
path: root/tools/darwin
diff options
context:
space:
mode:
Diffstat (limited to 'tools/darwin')
-rw-r--r--tools/darwin/depends/.autom4te.cfg3
-rw-r--r--tools/darwin/depends/COPYING674
-rw-r--r--tools/darwin/depends/Makefile.in36
-rw-r--r--tools/darwin/depends/Makefile.include.in13
-rw-r--r--tools/darwin/depends/README20
-rw-r--r--tools/darwin/depends/afpfs-ng/01-gcrypt.patch26
-rw-r--r--tools/darwin/depends/afpfs-ng/Makefile40
-rw-r--r--tools/darwin/depends/autoconf/Makefile39
-rw-r--r--tools/darwin/depends/automake/Makefile38
-rw-r--r--tools/darwin/depends/boost/Makefile36
-rw-r--r--tools/darwin/depends/boost/user-config.jam.in5
-rwxr-xr-xtools/darwin/depends/bootstrap1
-rw-r--r--tools/darwin/depends/cmake/Makefile38
-rwxr-xr-xtools/darwin/depends/config.site_ios.mk.in43
-rw-r--r--tools/darwin/depends/config.site_osx.in58
-rw-r--r--tools/darwin/depends/config.site_osx.mk.in49
-rw-r--r--tools/darwin/depends/configure.in91
-rw-r--r--tools/darwin/depends/curl/Makefile37
-rw-r--r--tools/darwin/depends/dpkg/Makefile44
-rw-r--r--tools/darwin/depends/expat/Makefile37
-rw-r--r--tools/darwin/depends/fontconfig/01-fontconfig-cross-compile-fix.patch80
-rw-r--r--tools/darwin/depends/fontconfig/Makefile41
-rw-r--r--tools/darwin/depends/freetype2/Makefile40
-rw-r--r--tools/darwin/depends/fribidi/Makefile38
-rw-r--r--tools/darwin/depends/gettext/01-gettext-tools-Makefile.in.patch11
-rw-r--r--tools/darwin/depends/gettext/Makefile45
-rw-r--r--tools/darwin/depends/help2man/Makefile39
-rw-r--r--tools/darwin/depends/jpeg/Makefile37
-rw-r--r--tools/darwin/depends/libGLEW/01-Makefile.patch19
-rw-r--r--tools/darwin/depends/libGLEW/02-Makefile.darwin.patch20
-rw-r--r--tools/darwin/depends/libGLEW/Makefile42
-rw-r--r--tools/darwin/depends/libass/Makefile37
-rw-r--r--tools/darwin/depends/libbluray/Makefile40
-rw-r--r--tools/darwin/depends/libcdio/Makefile39
-rw-r--r--tools/darwin/depends/libcrystalhd/Makefile15
-rw-r--r--tools/darwin/depends/libcrystalhd/libcrystalhd/bc_dts_defs.h635
-rw-r--r--tools/darwin/depends/libcrystalhd/libcrystalhd/bc_dts_types.h68
-rw-r--r--tools/darwin/depends/libcrystalhd/libcrystalhd/libcrystalhd_if.h1515
-rw-r--r--tools/darwin/depends/libcrystalhd/libcrystalhd/libcrystalhd_version.h80
-rw-r--r--tools/darwin/depends/libflac/Makefile40
-rw-r--r--tools/darwin/depends/libgcrypt/Makefile41
-rw-r--r--tools/darwin/depends/libgpg-error/Makefile41
-rw-r--r--tools/darwin/depends/liblzo2/01-liblzo2-only-build-lib.patch25
-rw-r--r--tools/darwin/depends/liblzo2/Makefile39
-rw-r--r--tools/darwin/depends/libmad/01-libmad-pkgconfig.patch117
-rw-r--r--tools/darwin/depends/libmad/Makefile39
-rw-r--r--tools/darwin/depends/libmicrohttpd/Makefile38
-rw-r--r--tools/darwin/depends/libmodplug/Makefile37
-rw-r--r--tools/darwin/depends/libmpeg2/01-libmpeg2-add-asm-leading-underscores.patch48
-rw-r--r--tools/darwin/depends/libmpeg2/02-neon.patch385
-rw-r--r--tools/darwin/depends/libmpeg2/03-config-fix.patch208
-rw-r--r--tools/darwin/depends/libmpeg2/Makefile40
-rw-r--r--tools/darwin/depends/libogg/Makefile37
-rw-r--r--tools/darwin/depends/libpng/Makefile37
-rw-r--r--tools/darwin/depends/librtmp/01-make_shared_lib_for_darwin-tag2.3.patch85
-rw-r--r--tools/darwin/depends/librtmp/Makefile37
-rw-r--r--tools/darwin/depends/libsamplerate/01-libsamplerate-arm.patch13
-rw-r--r--tools/darwin/depends/libsamplerate/Makefile39
-rw-r--r--tools/darwin/depends/libsdl/01-SDL_SetWidthHeight.patch32
-rw-r--r--tools/darwin/depends/libsdl/Makefile40
-rw-r--r--tools/darwin/depends/libsdl_image/Makefile38
-rw-r--r--tools/darwin/depends/libsdl_mixer/Makefile40
-rw-r--r--tools/darwin/depends/libssh2/Makefile42
-rw-r--r--tools/darwin/depends/libtool/Makefile39
-rw-r--r--tools/darwin/depends/libvorbis/Makefile40
-rw-r--r--tools/darwin/depends/libwavpack/Makefile37
-rw-r--r--tools/darwin/depends/mysqlclient/Makefile40
-rw-r--r--tools/darwin/depends/openssl/Makefile38
-rw-r--r--tools/darwin/depends/pcre/Makefile38
-rw-r--r--tools/darwin/depends/pkg-config/Makefile38
-rw-r--r--tools/darwin/depends/python26/Makefile43
-rw-r--r--tools/darwin/depends/readline/Makefile38
-rw-r--r--tools/darwin/depends/samba/Makefile50
-rw-r--r--tools/darwin/depends/sqlite3/Makefile42
-rw-r--r--tools/darwin/depends/tar/Makefile39
-rw-r--r--tools/darwin/depends/tiff/Makefile37
-rw-r--r--tools/darwin/depends/xbmc/Makefile15
-rw-r--r--tools/darwin/depends/yasm/Makefile41
-rwxr-xr-xtools/darwin/runtime/XBMCHelperbin0 -> 256264 bytes
-rw-r--r--tools/darwin/runtime/org.xbmc.helper.plist15
-rwxr-xr-xtools/darwin/runtime/preflight176
81 files changed, 6473 insertions, 0 deletions
diff --git a/tools/darwin/depends/.autom4te.cfg b/tools/darwin/depends/.autom4te.cfg
new file mode 100644
index 0000000000..1739545a6d
--- /dev/null
+++ b/tools/darwin/depends/.autom4te.cfg
@@ -0,0 +1,3 @@
+begin-language: "Autoconf"
+ args: --no-cache
+end-language: "Autoconf"
diff --git a/tools/darwin/depends/COPYING b/tools/darwin/depends/COPYING
new file mode 100644
index 0000000000..94a9ed024d
--- /dev/null
+++ b/tools/darwin/depends/COPYING
@@ -0,0 +1,674 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. 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
+them 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 prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. 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.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey 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;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If 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 convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU 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 that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ 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.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+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.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+ 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
+state 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 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that 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/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+ If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+ <program> Copyright (C) <year> <name of author>
+ This program 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, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+ You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+ The GNU General Public License does not permit incorporating your program
+into proprietary programs. If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library. If this is what you want to do, use the GNU Lesser General
+Public License instead of this License. But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/tools/darwin/depends/Makefile.in b/tools/darwin/depends/Makefile.in
new file mode 100644
index 0000000000..2d2b5ded78
--- /dev/null
+++ b/tools/darwin/depends/Makefile.in
@@ -0,0 +1,36 @@
+include Makefile.include
+
+BUILDTOOLS = help2man autoconf automake libtool pkg-config yasm cmake
+
+SUBDIRS = \
+ pcre expat gettext readline sqlite3 \
+ liblzo2 freetype2 fontconfig \
+ openssl libssh2 curl \
+ jpeg tiff libpng libogg \
+ libvorbis libflac libmad fribidi libwavpack libmpeg2 \
+ libass libcdio libsamplerate librtmp libcrystalhd \
+ libGLEW libsdl libsdl_mixer libsdl_image \
+ libmicrohttpd libmodplug libbluray \
+ samba python26 mysqlclient boost \
+
+.PHONY: $(BUILDTOOLS) $(SUBDIRS)
+
+all: $(BUILDTOOLS) $(SUBDIRS)
+
+$(BUILDTOOLS):
+ $(MAKE) -C $@
+
+$(SUBDIRS):
+ $(MAKE) -C $@
+
+clean:
+ for d in $(BUILDTOOLS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
+ for d in $(SUBDIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d clean; fi; done
+
+distclean::
+ for d in $(BUILDTOOLS); do if test -f $$d/Makefile; then $(MAKE) -C $$d distclean; fi; done
+ for d in $(SUBDIRS); do if test -f $$d/Makefile; then $(MAKE) -C $$d distclean; fi; done
+ find . -name .gitignore -exec rm -rf {} \;
+ rm -rf $(TOOLCHAIN)
+ rm -rf $(PREFIX)
+ rm -f Makefile Makefile.include config.site config.site.mk config.log config.status configure
diff --git a/tools/darwin/depends/Makefile.include.in b/tools/darwin/depends/Makefile.include.in
new file mode 100644
index 0000000000..ed957397eb
--- /dev/null
+++ b/tools/darwin/depends/Makefile.include.in
@@ -0,0 +1,13 @@
+SDK=@use_sdk@
+ARCH=@use_arch@
+DAWRIN=@use_darwin@
+PREFIX=@use_prefix@
+STAGING=@use_staging@
+TOOLCHAIN=@use_toolchain@
+TARBALLS_LOCATION=@use_staging@/tarballs
+BASE_URL=http://mirrors.xbmc.org/build-deps/darwin-libs
+
+RETRIEVE_TOOL=/usr/bin/curl
+RETRIEVE_TOOL_FLAGS=-Ls --create-dirs --output $(TARBALLS_LOCATION)/$(ARCHIVE)
+ARCHIVE_TOOL=tar
+ARCHIVE_TOOL_FLAGS=xf
diff --git a/tools/darwin/depends/README b/tools/darwin/depends/README
new file mode 100644
index 0000000000..9480343228
--- /dev/null
+++ b/tools/darwin/depends/README
@@ -0,0 +1,20 @@
+Build xbmc depends libs for osx and ios.
+
+This build system uses a configure's config.site file method of setting up for cross-compiling. ${PREFIX}/share/config.site defines all the items and tweaks required and simply doing ./configure --prefix=<some prefix> will enabled the usage.
+
+We support drawn cross-compiles for OSX and iOS with selection of SDK.
+Options are;
+--with-staging depends build location (/Users/Shared/xbmc-depends).
+--with-darwin build depend libs for darwin osx (default) or ios.
+--with-arch build depend libs for arch i386 (default), ppc or arm7.
+--with-sdk build depend libs using sdk 10.4 (default) or 4.2.
+
+Unfortunately some libraries do not use a configure based setup/compile so we must keep both a config.site seed and duplicate config.site.mk for including in the Makefile. It is very important to keep both files in sync and note their syntax differences as config.site runs under the shell and config.site.mk runs under make.
+
+For OSX, see;
+osx-config.site.in
+osx-config.site.mk.in
+
+For iOS, see;
+ios-config.site.in
+ios-config.site.mk.in \ No newline at end of file
diff --git a/tools/darwin/depends/afpfs-ng/01-gcrypt.patch b/tools/darwin/depends/afpfs-ng/01-gcrypt.patch
new file mode 100644
index 0000000000..7bcace2812
--- /dev/null
+++ b/tools/darwin/depends/afpfs-ng/01-gcrypt.patch
@@ -0,0 +1,26 @@
+diff -ru afpfs-ng-0.8.1/configure.ac afpfs-ng-0.8.1+iPhone/configure.ac
+--- afpfs-ng-0.8.1/configure.ac 2008-03-08 16:23:12.000000000 +0000
++++ afpfs-ng-0.8.1+iPhone/configure.ac 2010-10-24 05:26:15.000000000 +0000
+@@ -50,21 +50,6 @@
+ case $host in
+ *-*-darwin*)
+ AC_MSG_CHECKING([for correct gcrypt version])
+- AC_RUN_IFELSE(
+- [AC_LANG_PROGRAM([
+- #include <gcrypt.h>
+- #include <stdio.h>],[
+- char*p= GCRYPT_VERSION;
+- unsigned int vers;
+- vers=atoi(p)*10000;
+- p=strchr(p,'.')+1;
+- vers+=atoi(p)*100;
+- p=strchr(p,'.')+1;
+- vers+=atoi(p);
+- if (vers<10400) return 1;
+- ])],
+- [AC_MSG_RESULT([yes])],
+- [AC_MSG_ERROR([version is < 1.4.0])])
+ AM_CONDITIONAL(HAVE_LIBGCRYPT, true)
+ AC_DEFINE([HAVE_LIBGCRYPT], [1] )
+ ;;
+
diff --git a/tools/darwin/depends/afpfs-ng/Makefile b/tools/darwin/depends/afpfs-ng/Makefile
new file mode 100644
index 0000000000..a9759264ed
--- /dev/null
+++ b/tools/darwin/depends/afpfs-ng/Makefile
@@ -0,0 +1,40 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=afpfs-ng
+VERSION=0.8.1
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.bz2
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --disable-fuse
+
+LIBDYLIB=$(SOURCE)/lib/.libs/libafpclient.dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); patch -p1 <../01-gcrypt.patch
+ cd $(SOURCE); autoreconf -vif
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm-f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/autoconf/Makefile b/tools/darwin/depends/autoconf/Makefile
new file mode 100644
index 0000000000..b6ee79196f
--- /dev/null
+++ b/tools/darwin/depends/autoconf/Makefile
@@ -0,0 +1,39 @@
+include ../Makefile.include
+
+# lib name, version
+APPNAME=autoconf
+VERSION=2.63
+SOURCE=$(APPNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+export PATH:=$(TOOLCHAIN)/bin:$(PATH)
+CONFIGURE=./configure --prefix=$(TOOLCHAIN)
+
+APP=$(SOURCE)/bin/$(APPNAME)
+
+all: $(APP) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ sed -i bak -e "s/'libtoolize'/'glibtoolize'/" $(SOURCE)/bin/autoreconf.in
+ cd $(SOURCE); $(CONFIGURE)
+
+$(APP): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/automake/Makefile b/tools/darwin/depends/automake/Makefile
new file mode 100644
index 0000000000..2d6b78a522
--- /dev/null
+++ b/tools/darwin/depends/automake/Makefile
@@ -0,0 +1,38 @@
+include ../Makefile.include
+
+# lib name, version
+APPNAME=automake
+VERSION=1.10.3
+SOURCE=$(APPNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+export PATH:=$(TOOLCHAIN)/bin:$(PATH)
+CONFIGURE=./configure --prefix=$(TOOLCHAIN)
+
+APP=$(SOURCE)/bin/$(APPNAME)
+
+all: $(APP) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(APP): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/boost/Makefile b/tools/darwin/depends/boost/Makefile
new file mode 100644
index 0000000000..82a5dc55c6
--- /dev/null
+++ b/tools/darwin/depends/boost/Makefile
@@ -0,0 +1,36 @@
+include ../Makefile.include
+include ../config.site.mk
+
+LIBNAME=boost
+VERSION=1_44_0
+SOURCE=$(LIBNAME)_$(VERSION)
+ARCHIVE=$(SOURCE).tar.bz2
+
+LIBDYLIB=$(PREFIX)/lib/libboost_thread.dylib
+
+all: $(LIBDYLIB)
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(LIBDYLIB): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ sed -e "s?@boost_flags@?$(boost_flags)?g" \
+ -e "s?@platform_gcc_version@?$(platform_gcc_version)?g" \
+ user-config.jam.in >> $(SOURCE)/tools/build/v2/user-config.jam
+ cd $(SOURCE); ./bootstrap.sh --prefix=$(PREFIX) --with-libraries=thread
+ cd $(SOURCE); ./bjam --prefix=$(PREFIX) $(bjam_args) install
+
+clean:
+ cd $(SOURCE); ./bjam --clean
+ rm -rf $(PREFIX)/include/boost
+ rm -f $(PREFIX)/lib/libboost*
+ rm -f .installed
+
+distclean::
+ rm -rf $(PREFIX)/include/boost
+ rm -f $(PREFIX)/lib/libboost*
+ rm -rf $(SOURCE) .installed
+
diff --git a/tools/darwin/depends/boost/user-config.jam.in b/tools/darwin/depends/boost/user-config.jam.in
new file mode 100644
index 0000000000..ed7353b13e
--- /dev/null
+++ b/tools/darwin/depends/boost/user-config.jam.in
@@ -0,0 +1,5 @@
+using darwin : @platform_gcc_version@ : g++-@platform_gcc_version@ :
+ <cflags>"-isysroot @boost_flags@ -fvisibility=hidden -fvisibility-inlines-hidden -DBOOST_AC_USE_PTHREADS -DBOOST_SP_USE_PTHREADS"
+ <cxxflags>"-isysroot @boost_flags@ -fvisibility=hidden -fvisibility-inlines-hidden -DBOOST_AC_USE_PTHREADS -DBOOST_SP_USE_PTHREADS"
+ <linkflags>"-Wl,-syslibroot,@boost_flags@"
+;
diff --git a/tools/darwin/depends/bootstrap b/tools/darwin/depends/bootstrap
new file mode 100755
index 0000000000..171a93908c
--- /dev/null
+++ b/tools/darwin/depends/bootstrap
@@ -0,0 +1 @@
+autoconf
diff --git a/tools/darwin/depends/cmake/Makefile b/tools/darwin/depends/cmake/Makefile
new file mode 100644
index 0000000000..0ad221c898
--- /dev/null
+++ b/tools/darwin/depends/cmake/Makefile
@@ -0,0 +1,38 @@
+include ../Makefile.include
+
+# lib name, version
+APPNAME=cmake
+VERSION=2.8.4
+SOURCE=$(APPNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+export PATH:=$(TOOLCHAIN)/bin:$(PATH)
+CONFIGURE=./bootstrap --prefix=$(TOOLCHAIN)
+
+APP=$(SOURCE)/$(APPNAME)
+
+all: $(APP) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(APP): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/config.site_ios.mk.in b/tools/darwin/depends/config.site_ios.mk.in
new file mode 100755
index 0000000000..6fac9490b9
--- /dev/null
+++ b/tools/darwin/depends/config.site_ios.mk.in
@@ -0,0 +1,43 @@
+
+prefix_path=/Users/Shared/xbmc-depends/ios-4.2_arm7
+
+host_alias=arm-apple-darwin10
+platform_gcc_version=4.2
+platform_sdk_version:=$(shell xcodebuild -showsdks | grep iphoneos | sort | tail -n 1 | awk '{ print $$2}')
+
+platform_min_version=iphoneos-version-min=4.1
+platform_path=/Developer/Platforms/iPhoneOS.platform/Developer
+platform_os_cflags=-arch @use_arch@ -mcpu=cortex-a8 -mfpu=neon -ftree-vectorize -mfloat-abi=softfp -pipe -Wno-trigraphs -fpascal-strings -Os -Wreturn-type -Wunused-variable -fmessage-length=0 -gdwarf-2
+platform_os_ldflags=-arch @use_arch@ -mcpu=cortex-a8
+platform_sdk_path=${platform_path}/SDKs/iPhoneOS${platform_sdk_version}.sdk
+
+export HOST=${host_alias}
+export PREFIX=${prefix_path}
+export DEVROOT=${platform_path}
+export SDKROOT=${platform_sdk_path}
+
+export NM=/usr/bin/nm
+export CPP=/usr/bin/cpp-${platform_gcc_version}
+export CXXCPP=${CPP}
+#export CXXCPP=${CPP} -I${platform_sdk_path}/usr/include/c++/4.2.1/${platform_host}
+export CPPFLAGS=-no-cpp-precomp -I${PREFIX}/include
+#export CPPFLAGS=-I${platform_sdk_path}/usr/include -I${PREFIX}/include
+export CC=/usr/bin/gcc-${platform_gcc_version}
+#export CC=${platform_path}/usr/bin/${platform_host}-gcc-4.2.1
+export CFLAGS=-std=gnu99 -no-cpp-precomp -m${platform_min_version} -isysroot ${platform_sdk_path} ${platform_os_cflags} -I${platform_sdk_path}/usr/include
+export LD=${platform_path}/usr/bin/ld
+export LDFLAGS=-m${platform_min_version} -isysroot ${platform_sdk_path} -L${platform_sdk_path}/usr/lib -L${platform_sdk_path}/usr/lib/system ${platform_os_ldflags} -L${PREFIX}/lib
+export CXX=${platform_path}/usr/bin/${platform_host}-g++-4.2.1 -I${platform_sdk_path}/usr/include/c++/4.2.1/${platform_host}
+export CXXFLAGS=-m${platform_min_version} -isysroot ${platform_sdk_path} ${platform_os_cflags}
+export AR=${platform_path}/usr/bin/ar
+export AS=${PREFIX}/bin/gas-preprocessor.pl ${CC}
+export CCAS=--tag CC ${PREFIX}/bin/gas-preprocessor.pl ${CC}
+export STRIP=${platform_path}/usr/bin/strip
+export RANLIB=${platform_path}/usr/bin/ranlib
+export ACLOCAL=aclocal -I ${PREFIX}/share/aclocal -I @use_toolchain@share/aclocal -I ${platform_path}/usr/share/aclocal
+#export ACLOCAL=aclocal -I ${PREFIX}/share/aclocal -I /Developer/usr/share/aclocal
+export LIBTOOL=/Developer/usr/bin/glibtool
+export LIBTOOLIZE=/Developer/usr/bin/glibtoolize
+export PKG_CONFIG_PATH=${PREFIX}/usr/lib/pkgconfig:${platform_sdk_path}/usr/lib/pkgconfig
+export PATH:=@use_toolchain@/bin:${PREFIX}/bin:${platform_path}/usr/bin:/Developer/usr/bin:${PATH}
+
diff --git a/tools/darwin/depends/config.site_osx.in b/tools/darwin/depends/config.site_osx.in
new file mode 100644
index 0000000000..ccbb64a060
--- /dev/null
+++ b/tools/darwin/depends/config.site_osx.in
@@ -0,0 +1,58 @@
+if test "@use_sdk@" = "10.4" ; then
+ if test "@use_arch@" = "ppc" ; then
+ host_alias=powerpc-apple-darwin8
+ else
+ host_alias=i386-apple-darwin8
+ fi
+ platform_gcc_version=4.0
+ platform_sdk_version=@use_sdk@u
+else
+ host_alias=i686-apple-darwin
+ platform_gcc_version=4.2
+ platform_sdk_version=@use_sdk@
+fi
+platform_min_version=macosx-version-min=@use_sdk@
+platform_path="/Developer"
+platform_os_cflags="-arch @use_arch@ -no_compact_linkedit"
+platform_os_ldflags="-arch @use_arch@ -Wl,-arch,@use_arch@ -no_compact_linkedit"
+platform_sdk_path="${platform_path}/SDKs/MacOSX${platform_sdk_version}.sdk"
+
+export NM=/usr/bin/nm
+export CPP=/usr/bin/cpp-${platform_gcc_version}
+export CXXCPP=${CPP}
+export CPPFLAGS="-no-cpp-precomp -I${prefix}/include"
+export CC=/usr/bin/gcc-${platform_gcc_version}
+export CFLAGS="-std=gnu89 -no-cpp-precomp -m${platform_min_version} -isysroot ${platform_sdk_path} ${platform_os_cflags} -I${platform_sdk_path}/usr/include"
+export LD=${platform_path}/usr/bin/ld
+export LDFLAGS="-m${platform_min_version} -isysroot ${platform_sdk_path} ${platform_os_ldflags} -L${prefix}/lib -L${platform_sdk_path}/usr/lib"
+export CXX=/usr/bin/g++-${platform_gcc_version}
+export CXXFLAGS="-m${platform_min_version} -isysroot ${platform_sdk_path} ${platform_os_cflags}"
+export AR=${platform_path}/usr/bin/ar
+export AS=${platform_path}/usr/bin/as
+export STRIP=${platform_path}/usr/bin/strip
+export RANLIB=${platform_path}/usr/bin/ranlib
+export ACLOCAL="aclocal -I ${prefix}/share/aclocal -I @use_toolchain@/share/aclocal -I ${platform_path}/usr/share/aclocal"
+export LIBTOOL=@use_toolchain@/bin/glibtool
+export LIBTOOLIZE=@use_toolchain@/bin/glibtoolize
+export PKG_CONFIG_PATH=${prefix}/usr/lib/pkgconfig:${platform_sdk_path}/usr/lib/pkgconfig
+export PATH="@use_toolchain@/bin:${prefix}/bin:${platform_path}/usr/bin:/Developer/usr/bin:${PATH}"
+export MACOSX_DEPLOYMENT_TARGET=@use_sdk@
+
+# tweaks for samba
+if test "${PACKAGE_NAME}" = "Samba" ; then
+ # disable python support
+ export PYTHON_VER=0.0
+ # ios/osx-10.6 issue with collision of _MD5 exported from a system lib
+ export LDFLAGS="${LDFLAGS} -Wl,-unexported_symbol,_MD5* -lc"
+ # uses OPT instead of CFLAGS
+ export OPT="${CFLAGS}"
+ # various configure overrides
+ ac_cv_header_libunwind_h=no
+ ac_cv_header_execinfo_h=no
+ samba_cv_SYSCONF_SC_NPROCESSORS_ONLN=no
+fi
+
+# tweaks for python
+if test "${PACKAGE_NAME}" = "python" ; then
+ export OPT="${CFLAGS}"
+fi
diff --git a/tools/darwin/depends/config.site_osx.mk.in b/tools/darwin/depends/config.site_osx.mk.in
new file mode 100644
index 0000000000..7b71d797c1
--- /dev/null
+++ b/tools/darwin/depends/config.site_osx.mk.in
@@ -0,0 +1,49 @@
+ifeq ("@use_sdk@", "10.4")
+ ifeq ("@use_arch@", "ppc")
+ host_alias=powerpc-apple-darwin8
+ else
+ host_alias=i386-apple-darwin8
+ endif
+ platform_gcc_version=4.0
+ platform_sdk_version=@use_sdk@u
+else
+ host_alias=i686-apple-darwin
+ platform_gcc_version=4.2
+ platform_sdk_version=@use_sdk@
+endif
+
+platform_min_version=macosx-version-min=@use_sdk@
+platform_path=/Developer
+platform_os_cflags=-arch @use_arch@ -no_compact_linkedit
+platform_os_ldflags=-arch @use_arch@ -no_compact_linkedit
+platform_sdk_path=${platform_path}/SDKs/MacOSX${platform_sdk_version}.sdk
+
+export NM=/usr/bin/nm
+export CPP=/usr/bin/cpp-${platform_gcc_version}
+export CXXCPP=${CPP}
+export CPPFLAGS=-no-cpp-precomp -I${PREFIX}/include
+export CC=/usr/bin/gcc-${platform_gcc_version}
+export CFLAGS=-std=gnu89 -no-cpp-precomp -m${platform_min_version} -isysroot ${platform_sdk_path} ${platform_os_cflags} -I${platform_sdk_path}/usr/include
+export LD=${platform_path}/usr/bin/ld
+export LDFLAGS=-m${platform_min_version} -isysroot ${platform_sdk_path} ${platform_os_ldflags} -L${PREFIX}/lib -L${platform_sdk_path}/usr/lib
+export CXX=/usr/bin/g++-${platform_gcc_version}
+export CXXFLAGS=-m${platform_min_version} -isysroot ${platform_sdk_path} ${platform_os_cflags}
+export AR=${platform_path}/usr/bin/ar
+export AS=${platform_path}/usr/bin/as
+export STRIP=${platform_path}/usr/bin/strip
+export RANLIB=${platform_path}/usr/bin/ranlib
+export ACLOCAL=aclocal -I ${PREFIX}/share/aclocal -I @use_toolchain@share/aclocal -I ${platform_path}/usr/share/aclocal
+export LIBTOOL=@use_toolchain@/bin/glibtool
+export LIBTOOLIZE=@use_toolchain@/bin/glibtoolize
+export PKG_CONFIG_PATH=${PREFIX}/usr/lib/pkgconfig:${platform_sdk_path}/usr/lib/pkgconfig
+export PATH:=@use_toolchain@/bin:${PREFIX}/bin:${platform_path}/usr/bin:/Developer/usr/bin:${PATH}
+export MACOSX_DEPLOYMENT_TARGET=@use_sdk@
+
+# tweaks for boost
+ifeq ("@use_arch@", "ppc")
+ boost_architecture=power
+else
+ boost_architecture=x86
+endif
+bjam_args=toolset=darwin-${platform_gcc_version} --architecture=${boost_architecture} address-model=32 target-os=darwin macosx-version=@use_sdk@ macosx-version-min=@use_sdk@ --link=static
+boost_flags=${platform_sdk_path} -arch @use_arch@
diff --git a/tools/darwin/depends/configure.in b/tools/darwin/depends/configure.in
new file mode 100644
index 0000000000..2b3d69eaa0
--- /dev/null
+++ b/tools/darwin/depends/configure.in
@@ -0,0 +1,91 @@
+AC_PREREQ(2.59)
+AC_INIT([darwin-depends], [1.00], [http://trac.xbmc.org])
+
+AC_ARG_WITH([staging],
+ [AS_HELP_STRING([--with-staging],
+ [depends build location (/Users/Shared/xbmc-depends).])],
+ [use_staging=$withval],
+ [use_staging="/Users/Shared/xbmc-depends"])
+
+AC_ARG_WITH([darwin],
+ [AS_HELP_STRING([--with-darwin],
+ [build depend libs for darwin osx (default) or ios.])],
+ [use_darwin=$withval],
+ [use_darwin="osx"])
+
+AC_ARG_WITH([arch],
+ [AS_HELP_STRING([--with-arch],
+ [build depend libs for arch i386 (default), x86_64, ppc or arm7.])],
+ [use_arch=$withval],
+ [use_arch="i386"])
+
+AC_ARG_WITH([sdk],
+ [AS_HELP_STRING([--with-sdk],
+ [build depend libs using sdk 10.4 (default) or 4.2.])],
+ [use_sdk=$withval],
+ [use_sdk="10.4"])
+
+OUTPUT_FILES="Makefile Makefile.include"
+AC_MSG_RESULT(configuring for darwin $use_darwin-$use_sdk-$use_arch)
+case $use_darwin in
+ osx)
+ if test "$use_arch" = "arm7"; then
+ AC_MSG_ERROR(error in configure of --with-arch=$use_arch)
+ fi
+ if test "$use_sdk" != "10.4"; then
+ AC_MSG_ERROR(error in configure of --with-sdk=$use_sdk)
+ fi
+ CONFIG_SITE=" [config.site:config.site_osx.in]"
+ MK_CONFIG_SITE=" [config.site.mk:config.site_osx.mk.in]"
+ ;;
+ ios)
+ if test "$use_arch" != "arm7"; then
+ AC_MSG_ERROR(error in configure of --with-arch=$use_arch)
+ fi
+ if test "$use_sdk" != "4.2"; then
+ AC_MSG_ERROR(error in configure of --with-sdk=$use_sdk)
+ fi
+ CONFIG_SITE=" [config.site:config.site_ios.in]"
+ MK_CONFIG_SITE=" [config.site.mk:config.site_ios.mk.in]"
+ ;;
+ *)
+ AC_MSG_ERROR(error in configure of ($host))
+esac
+
+OUTPUT_FILES+=${CONFIG_SITE}
+OUTPUT_FILES+=${MK_CONFIG_SITE}
+
+use_toolchain=${use_staging}/toolchain
+AC_MSG_RESULT(creating build toolchain at $use_toolchain)
+mkdir -p ${use_toolchain}
+
+AC_MSG_RESULT(creating tarball storage at $use_staging)
+mkdir -p ${use_staging}/tarballs
+
+use_prefix=${use_staging}/${use_darwin}-${use_sdk}_${use_arch}
+AC_MSG_RESULT(creating hostroot at $use_staging)
+
+AC_MSG_RESULT(creating hostroot dirs at $use_prefix)
+mkdir -p ${use_prefix}/bin
+mkdir -p ${use_prefix}/lib
+mkdir -p ${use_prefix}/slib
+mkdir -p ${use_prefix}/share
+mkdir -p ${use_prefix}/share/aclocal
+mkdir -p ${use_prefix}/include
+
+
+AC_SUBST(use_toolchain)
+AC_SUBST(use_staging)
+AC_SUBST(use_prefix)
+AC_SUBST(use_darwin)
+AC_SUBST(use_arch)
+AC_SUBST(use_sdk)
+
+AC_CONFIG_FILES([${OUTPUT_FILES}])
+
+AC_OUTPUT
+
+AC_MSG_RESULT(setting up config.site files)
+cp config.site ${use_prefix}/share/config.site
+
+
diff --git a/tools/darwin/depends/curl/Makefile b/tools/darwin/depends/curl/Makefile
new file mode 100644
index 0000000000..da6362cb2c
--- /dev/null
+++ b/tools/darwin/depends/curl/Makefile
@@ -0,0 +1,37 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=curl
+VERSION=7.19.4
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.bz2
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX)
+
+LIBDYLIB=$(SOURCE)/.libs/(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/dpkg/Makefile b/tools/darwin/depends/dpkg/Makefile
new file mode 100644
index 0000000000..a9a77ad64f
--- /dev/null
+++ b/tools/darwin/depends/dpkg/Makefile
@@ -0,0 +1,44 @@
+include ../Makefile.include
+
+# lib name, version
+APPNAME=dpkg
+VERSION=1.14.30
+SOURCE=$(APPNAME)_$(VERSION)
+SOURCE_DEBIAN=$(APPNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+export LIBTOOL=builds/unix/libtool
+export PATH:=$(PREFIX)/bin:$(PATH)
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --enable-static --disable-shared
+
+CLEAN_FILES=$(ARCHIVE) $(SOURCE_DEBIAN)
+
+all: $(APPNAME) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE_DEBIAN): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE_DEBIAN)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE_DEBIAN) > .gitignore
+ cd $(SOURCE_DEBIAN); $(CONFIGURE)
+
+$(APPNAME): $(SOURCE_DEBIAN)
+ make -C $(SOURCE_DEBIAN)/lib CFLAGS="" LDFLAGS=""
+ make -C $(SOURCE_DEBIAN)/libcompat CFLAGS="" LDFLAGS=""
+ make -C $(SOURCE_DEBIAN)/src CFLAGS="" LDFLAGS=""
+ make -C $(SOURCE_DEBIAN)/dpkg-deb CFLAGS="" LDFLAGS=""
+
+.installed:
+ make -C $(SOURCE_DEBIAN)/dpkg-deb install
+ touch $@
+
+clean:
+ make -C $(SOURCE_DEBIAN) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE_DEBIAN) .installed
+
diff --git a/tools/darwin/depends/expat/Makefile b/tools/darwin/depends/expat/Makefile
new file mode 100644
index 0000000000..9f593b53b4
--- /dev/null
+++ b/tools/darwin/depends/expat/Makefile
@@ -0,0 +1,37 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=expat
+VERSION=2.0.1
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX)
+
+LIBDYLIB=$(SOURCE)/.libs/(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/fontconfig/01-fontconfig-cross-compile-fix.patch b/tools/darwin/depends/fontconfig/01-fontconfig-cross-compile-fix.patch
new file mode 100644
index 0000000000..334cbbaf81
--- /dev/null
+++ b/tools/darwin/depends/fontconfig/01-fontconfig-cross-compile-fix.patch
@@ -0,0 +1,80 @@
+diff -Naur fontconfig-2.6.0.orig/doc/Makefile.am fontconfig-2.6.0/doc/Makefile.am
+--- fontconfig-2.6.0.orig/doc/Makefile.am 2007-11-06 01:05:37.000000000 +0100
++++ fontconfig-2.6.0/doc/Makefile.am 2010-05-22 00:03:00.000000000 +0200
+@@ -21,9 +21,10 @@
+ # TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ # PERFORMANCE OF THIS SOFTWARE.
+
+-CC = @CC_FOR_BUILD@
+ EXEEXT = @EXEEXT_FOR_BUILD@
+-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
++COMPILE = $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
++ $(CPPFLAGS_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD)
++LINK = $(CC_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD) -o $@
+
+ DOC_SRC = $(srcdir)
+ DOC_MODULE = fontconfig
+diff -Naur fontconfig-2.6.0.orig/fc-arch/Makefile.am fontconfig-2.6.0/fc-arch/Makefile.am
+--- fontconfig-2.6.0.orig/fc-arch/Makefile.am 2008-01-02 17:44:39.000000000 +0100
++++ fontconfig-2.6.0/fc-arch/Makefile.am 2010-05-21 23:59:18.000000000 +0200
+@@ -22,9 +22,10 @@
+ # PERFORMANCE OF THIS SOFTWARE.
+ #
+
+-CC = @CC_FOR_BUILD@
+ EXEEXT = @EXEEXT_FOR_BUILD@
+-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
++COMPILE = $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
++ $(CPPFLAGS_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD)
++LINK = $(CC_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD) -o $@
+
+ INCLUDES=-I${top_srcdir}/src -I${top_srcdir} $(WARN_CFLAGS)
+
+diff -Naur fontconfig-2.6.0.orig/fc-case/Makefile.am fontconfig-2.6.0/fc-case/Makefile.am
+--- fontconfig-2.6.0.orig/fc-case/Makefile.am 2010-05-21 23:55:02.000000000 +0200
++++ fontconfig-2.6.0/fc-case/Makefile.am 2010-05-22 00:04:09.000000000 +0200
+@@ -22,9 +22,10 @@
+ # PERFORMANCE OF THIS SOFTWARE.
+ #
+
+-CC = @CC_FOR_BUILD@
+ EXEEXT = @EXEEXT_FOR_BUILD@
+-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
++COMPILE = $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
++ $(CPPFLAGS_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD)
++LINK = $(CC_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD) -o $@
+
+ INCLUDES=-I${top_srcdir}/src -I${top_srcdir} $(WARN_CFLAGS)
+
+diff -Naur fontconfig-2.6.0.orig/fc-glyphname/Makefile.am fontconfig-2.6.0/fc-glyphname/Makefile.am
+--- fontconfig-2.6.0.orig/fc-glyphname/Makefile.am 2008-01-02 17:44:39.000000000 +0100
++++ fontconfig-2.6.0/fc-glyphname/Makefile.am 2010-05-22 00:04:54.000000000 +0200
+@@ -22,9 +22,10 @@
+ # PERFORMANCE OF THIS SOFTWARE.
+ #
+
+-CC = @CC_FOR_BUILD@
+ EXEEXT = @EXEEXT_FOR_BUILD@
+-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
++COMPILE = $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
++ $(CPPFLAGS_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD)
++LINK = $(CC_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD) -o $@
+
+ INCLUDES=-I${top_srcdir}/src -I${top_srcdir} $(WARN_CFLAGS)
+
+diff -Naur fontconfig-2.6.0.orig/fc-lang/Makefile.am fontconfig-2.6.0/fc-lang/Makefile.am
+--- fontconfig-2.6.0.orig/fc-lang/Makefile.am 2008-01-02 17:44:39.000000000 +0100
++++ fontconfig-2.6.0/fc-lang/Makefile.am 2010-05-22 00:05:44.000000000 +0200
+@@ -22,9 +22,10 @@
+ # PERFORMANCE OF THIS SOFTWARE.
+ #
+
+-CC = @CC_FOR_BUILD@
+ EXEEXT = @EXEEXT_FOR_BUILD@
+-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
++COMPILE = $(CC_FOR_BUILD) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
++ $(CPPFLAGS_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD)
++LINK = $(CC_FOR_BUILD) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD) -o $@
+
+ INCLUDES=-I${top_srcdir}/src -I${top_srcdir} $(WARN_CFLAGS)
+
diff --git a/tools/darwin/depends/fontconfig/Makefile b/tools/darwin/depends/fontconfig/Makefile
new file mode 100644
index 0000000000..63fb953723
--- /dev/null
+++ b/tools/darwin/depends/fontconfig/Makefile
@@ -0,0 +1,41 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=fontconfig
+VERSION=2.6.0
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --disable-libxml2 --disable-docs \
+ --with-freetype-config=$(PREFIX)/bin/freetype-config
+
+LIBDYLIB=$(SOURCE)/.libs/lib$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); patch -p1 < ../01-fontconfig-cross-compile-fix.patch
+ cd $(SOURCE); autoreconf -vif
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/freetype2/Makefile b/tools/darwin/depends/freetype2/Makefile
new file mode 100644
index 0000000000..f79eba659a
--- /dev/null
+++ b/tools/darwin/depends/freetype2/Makefile
@@ -0,0 +1,40 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=freetype
+VERSION=2.3.9
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.bz2
+
+# configuration settings
+# force using internal libtool
+export LIBTOOL=builds/unix/libtool
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --without-old-mac-fonts --without-fsspec --without-fsref --without-ats
+
+LIBDYLIB=$(SOURCE)/objs/.libs/lib$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/fribidi/Makefile b/tools/darwin/depends/fribidi/Makefile
new file mode 100644
index 0000000000..33b091415c
--- /dev/null
+++ b/tools/darwin/depends/fribidi/Makefile
@@ -0,0 +1,38 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=fribidi
+VERSION=0.19.1
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --disable-docs
+
+LIBDYLIB=$(SOURCE)/.libs/lib$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/gettext/01-gettext-tools-Makefile.in.patch b/tools/darwin/depends/gettext/01-gettext-tools-Makefile.in.patch
new file mode 100644
index 0000000000..da129dea47
--- /dev/null
+++ b/tools/darwin/depends/gettext/01-gettext-tools-Makefile.in.patch
@@ -0,0 +1,11 @@
+--- gettext-tools/Makefile.in.orig 2010-06-03 16:38:55.000000000 -0500
++++ gettext-tools/Makefile.in 2010-06-04 01:16:07.000000000 -0500
+@@ -724,7 +724,7 @@
+ top_srcdir = @top_srcdir@
+ AUTOMAKE_OPTIONS = 1.5 gnu no-dependencies
+ ACLOCAL_AMFLAGS = -I m4 -I ../gettext-runtime/m4 -I ../autoconf-lib-link/m4 -I ../m4 -I gnulib-m4 -I libgettextpo/gnulib-m4
+-SUBDIRS = doc intl gnulib-lib libgrep src libgettextpo po projects styles misc man m4 tests gnulib-tests examples
++SUBDIRS = doc intl gnulib-lib libgrep src libgettextpo po projects styles misc man m4 tests gnulib-tests
+
+ # Allow users to use "gnulib-tool --update".
+
diff --git a/tools/darwin/depends/gettext/Makefile b/tools/darwin/depends/gettext/Makefile
new file mode 100644
index 0000000000..ae94295fb3
--- /dev/null
+++ b/tools/darwin/depends/gettext/Makefile
@@ -0,0 +1,45 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=gettext
+VERSION=0.17
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --disable-csharp --disable-native-java --disable-java --without-emacs \
+ --disable-libasprintf --disable-openmp \
+ --with-included-gettext \
+ --with-included-glib \
+ --with-included-libcroco \
+ --with-included-libxml \
+ --without-git --without-cvs
+
+LIBDYLIB=$(SOURCE)/.libs/lib$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); patch -p0 <../01-gettext-tools-Makefile.in.patch
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/help2man/Makefile b/tools/darwin/depends/help2man/Makefile
new file mode 100644
index 0000000000..430cc004ab
--- /dev/null
+++ b/tools/darwin/depends/help2man/Makefile
@@ -0,0 +1,39 @@
+include ../Makefile.include
+
+# lib name, version
+APPNAME=help2man
+VERSION=1.38.2
+SOURCE=$(APPNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+export PATH:=$(TOOLCHAIN)/bin:$(PATH)
+CONFIGURE=./configure --prefix=$(TOOLCHAIN)
+
+APP=$(SOURCE)/$(APPNAME)
+
+all: $(APP) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ sed -ie "s/-shared/-dynamiclib/g" "$(SOURCE)/Makefile.in"
+ cd $(SOURCE); $(CONFIGURE)
+
+$(APP): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/jpeg/Makefile b/tools/darwin/depends/jpeg/Makefile
new file mode 100644
index 0000000000..da4abaee82
--- /dev/null
+++ b/tools/darwin/depends/jpeg/Makefile
@@ -0,0 +1,37 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=jpeg
+VERSION=8b
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(LIBNAME)src.v$(VERSION).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX)
+
+LIBDYLIB=$(SOURCE)/.libs/lib$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ -rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libGLEW/01-Makefile.patch b/tools/darwin/depends/libGLEW/01-Makefile.patch
new file mode 100644
index 0000000000..c48dbd460a
--- /dev/null
+++ b/tools/darwin/depends/libGLEW/01-Makefile.patch
@@ -0,0 +1,19 @@
+--- Makefile.orig 2010-11-04 07:55:35.000000000 +1100
++++ Makefile 2010-11-16 18:00:37.000000000 +1100
+@@ -89,7 +89,7 @@
+ mkdir bin
+
+ lib/$(LIB.STATIC): $(LIB.OBJS)
+- $(AR) cr $@ $^
++ $(AR) crs $@ $^
+
+ lib/$(LIB.SHARED): $(LIB.SOBJS)
+ $(LD) $(LDFLAGS.SO) -o $@ $^ $(LIB.LDFLAGS) $(LIB.LIBS)
+@@ -146,7 +146,6 @@
+ ifeq ($(filter-out mingw% cygwin,$(SYSTEM)),)
+ $(INSTALL) -m 0644 lib/$(LIB.DEVLNK) $(LIBDIR)/
+ else
+- $(STRIP) -x lib/$(LIB.STATIC)
+ $(INSTALL) -m 0644 lib/$(LIB.STATIC) $(LIBDIR)/
+ $(LN) $(LIB.SHARED) $(LIBDIR)/$(LIB.DEVLNK)
+ endif
diff --git a/tools/darwin/depends/libGLEW/02-Makefile.darwin.patch b/tools/darwin/depends/libGLEW/02-Makefile.darwin.patch
new file mode 100644
index 0000000000..d1b652a10b
--- /dev/null
+++ b/tools/darwin/depends/libGLEW/02-Makefile.darwin.patch
@@ -0,0 +1,20 @@
+--- config/Makefile.darwin.orig 2010-11-04 07:55:35.000000000 +1100
++++ config/Makefile.darwin 2010-11-16 18:28:44.000000000 +1100
+@@ -1,13 +1,13 @@
+ NAME = $(GLEW_NAME)
+-CC = cc
+-LD = cc
+-CFLAGS.EXTRA = -no-cpp-precomp -dynamic -fno-common
++CC = $(CC.ARCH)
++LD = $(CC.ARCH)
++CFLAGS.EXTRA = -dynamic -fno-common $(CFLAGS.ARCH)
+ ifneq (undefined, $(origin GLEW_MX))
+ CFLAGS.EXTRA += -DGLEW_MX
+ endif
+ PICFLAG = -fPIC
+ LDFLAGS.SO = -dynamiclib -install_name $(GLEW_DEST)/lib/$(LIB.SHARED)
+-LDFLAGS.EXTRA =
++LDFLAGS.EXTRA = $(LDFLAGS.ARCH)
+ ifneq (undefined, $(origin GLEW_APPLE_GLX))
+ CFLAGS.EXTRA += -I/usr/X11R6/include -D'GLEW_APPLE_GLX'
+ LDFLAGS.GL = -L/usr/X11R6/lib -lXmu -lXi -lGLU -lGL -lXext -lX11
diff --git a/tools/darwin/depends/libGLEW/Makefile b/tools/darwin/depends/libGLEW/Makefile
new file mode 100644
index 0000000000..a8dd0ecb93
--- /dev/null
+++ b/tools/darwin/depends/libGLEW/Makefile
@@ -0,0 +1,42 @@
+include ../Makefile.include
+include ../config.site.mk
+
+# lib name, version
+LIBNAME=glew
+VERSION=1.5.8
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tgz
+
+# configuration settings
+export GLEW_DEST=$(PREFIX)
+export CC.ARCH=$(CC)
+export CFLAGS.ARCH=$(CFLAGS)
+export LDFLAGS.ARCH=$(LDFLAGS)
+
+LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); patch -p0 < ../01-Makefile.patch
+ cd $(SOURCE); patch -p0 < ../02-Makefile.darwin.patch
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libass/Makefile b/tools/darwin/depends/libass/Makefile
new file mode 100644
index 0000000000..55dfbbca9e
--- /dev/null
+++ b/tools/darwin/depends/libass/Makefile
@@ -0,0 +1,37 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=libass
+VERSION=0.9.11
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.bz2
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX)
+
+LIBDYLIB=$(SOURCE)/$(LIBNAME)/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libbluray/Makefile b/tools/darwin/depends/libbluray/Makefile
new file mode 100644
index 0000000000..f0515fa067
--- /dev/null
+++ b/tools/darwin/depends/libbluray/Makefile
@@ -0,0 +1,40 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=libblueray
+VERSION=20110213.20739ed
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tgz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) --exec-prefix=$(PREFIX) \
+ --disable-examples --disable-doxygen-doc
+
+LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ mkdir $(SOURCE)
+ cd $(SOURCE); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); ./bootstrap
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libcdio/Makefile b/tools/darwin/depends/libcdio/Makefile
new file mode 100644
index 0000000000..f7f0428cf7
--- /dev/null
+++ b/tools/darwin/depends/libcdio/Makefile
@@ -0,0 +1,39 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=libcdio
+VERSION=0.82
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX)
+
+LIBDYLIB=$(SOURCE)/.libs/(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); autoconf
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ cp $(SOURCE)/include/cdio/cdtext.h $(PREFIX)/include/cdio/
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libcrystalhd/Makefile b/tools/darwin/depends/libcrystalhd/Makefile
new file mode 100644
index 0000000000..329757c0e2
--- /dev/null
+++ b/tools/darwin/depends/libcrystalhd/Makefile
@@ -0,0 +1,15 @@
+include ../Makefile.include
+
+SOURCE=libcrystalhd
+
+all: .installed
+
+.installed:
+ mkdir -p $(PREFIX)/include
+ cp -rf $(SOURCE) $(PREFIX)/include/
+ touch $@
+
+clean:
+distclean::
+ rm -f .installed
+
diff --git a/tools/darwin/depends/libcrystalhd/libcrystalhd/bc_dts_defs.h b/tools/darwin/depends/libcrystalhd/libcrystalhd/bc_dts_defs.h
new file mode 100644
index 0000000000..2bffb80631
--- /dev/null
+++ b/tools/darwin/depends/libcrystalhd/libcrystalhd/bc_dts_defs.h
@@ -0,0 +1,635 @@
+/********************************************************************
+ * Copyright(c) 2006-2009 Broadcom Corporation.
+ *
+ * Name: bc_dts_defs.h
+ *
+ * Description: Common definitions for all components. Only types
+ * is allowed to be included from this file.
+ *
+ * AU
+ *
+ * HISTORY:
+ *
+ ********************************************************************
+ * This header is free software: you can redistribute it 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.
+ *
+ * This header is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this header. If not, see <http://www.gnu.org/licenses/>.
+ *******************************************************************/
+
+#ifndef _BC_DTS_DEFS_H_
+#define _BC_DTS_DEFS_H_
+
+#include "bc_dts_types.h"
+
+/* BIT Mask */
+#define BC_BIT(_x) (1 << (_x))
+
+typedef enum _BC_STATUS {
+ BC_STS_SUCCESS = 0,
+ BC_STS_INV_ARG = 1,
+ BC_STS_BUSY = 2,
+ BC_STS_NOT_IMPL = 3,
+ BC_STS_PGM_QUIT = 4,
+ BC_STS_NO_ACCESS = 5,
+ BC_STS_INSUFF_RES = 6,
+ BC_STS_IO_ERROR = 7,
+ BC_STS_NO_DATA = 8,
+ BC_STS_VER_MISMATCH = 9,
+ BC_STS_TIMEOUT = 10,
+ BC_STS_FW_CMD_ERR = 11,
+ BC_STS_DEC_NOT_OPEN = 12,
+ BC_STS_ERR_USAGE = 13,
+ BC_STS_IO_USER_ABORT = 14,
+ BC_STS_IO_XFR_ERROR = 15,
+ BC_STS_DEC_NOT_STARTED = 16,
+ BC_STS_FWHEX_NOT_FOUND = 17,
+ BC_STS_FMT_CHANGE = 18,
+ BC_STS_HIF_ACCESS = 19,
+ BC_STS_CMD_CANCELLED = 20,
+ BC_STS_FW_AUTH_FAILED = 21,
+ BC_STS_BOOTLOADER_FAILED = 22,
+ BC_STS_CERT_VERIFY_ERROR = 23,
+ BC_STS_DEC_EXIST_OPEN = 24,
+ BC_STS_PENDING = 25,
+ BC_STS_CLK_NOCHG = 26,
+
+ /* Must be the last one.*/
+ BC_STS_ERROR = -1
+} BC_STATUS;
+
+/*------------------------------------------------------*
+ * Registry Key Definitions *
+ *------------------------------------------------------*/
+#define BC_REG_KEY_MAIN_PATH "Software\\Broadcom\\MediaPC\\CrystalHD"
+#define BC_REG_KEY_FWPATH "FirmwareFilePath"
+#define BC_REG_KEY_SEC_OPT "DbgOptions"
+
+/*
+ * Options:
+ *
+ * b[5] = Enable RSA KEY in EEPROM Support
+ * b[6] = Enable Old PIB scheme. (0 = Use PIB with video scheme)
+ *
+ * b[12] = Enable send message to NotifyIcon
+ *
+ */
+
+typedef enum _BC_SW_OPTIONS {
+ BC_OPT_DOSER_OUT_ENCRYPT = BC_BIT(3),
+ BC_OPT_LINK_OUT_ENCRYPT = BC_BIT(29),
+} BC_SW_OPTIONS;
+
+typedef struct _BC_REG_CONFIG{
+ uint32_t DbgOptions;
+} BC_REG_CONFIG;
+
+#if defined(__KERNEL__) || defined(__LINUX_USER__)
+#else
+/* Align data structures */
+#define ALIGN(x) __declspec(align(x))
+#endif
+
+/* mode
+ * b[0]..b[7] = _DtsDeviceOpenMode
+ * b[8] = Load new FW
+ * b[9] = Load file play back FW
+ * b[10] = Disk format (0 for HD DVD and 1 for BLU ray)
+ * b[11]-b[15] = default output resolution
+ * b[16] = Skip TX CPB Buffer Check
+ * b[17] = Adaptive Output Encrypt/Scramble Scheme
+ * b[18]-b[31] = reserved for future use
+ */
+
+/* To allow multiple apps to open the device. */
+enum _DtsDeviceOpenMode {
+ DTS_PLAYBACK_MODE = 0,
+ DTS_DIAG_MODE,
+ DTS_MONITOR_MODE,
+ DTS_HWINIT_MODE
+};
+
+/* To enable the filter to selectively enable/disable fixes or erratas */
+enum _DtsDeviceFixMode {
+ DTS_LOAD_NEW_FW = BC_BIT(8),
+ DTS_LOAD_FILE_PLAY_FW = BC_BIT(9),
+ DTS_DISK_FMT_BD = BC_BIT(10),
+ /* b[11]-b[15] : Default output resolution */
+ DTS_SKIP_TX_CHK_CPB = BC_BIT(16),
+ DTS_ADAPTIVE_OUTPUT_PER = BC_BIT(17),
+ DTS_INTELLIMAP = BC_BIT(18),
+ /* b[19]-b[21] : select clock frequency */
+ DTS_PLAYBACK_DROP_RPT_MODE = BC_BIT(22),
+ DTS_DIAG_TEST_MODE = BC_BIT(23),
+ DTS_SINGLE_THREADED_MODE = BC_BIT(24),
+ DTS_FILTER_MODE = BC_BIT(25),
+ DTS_MFT_MODE = BC_BIT(26)
+};
+
+#define DTS_DFLT_RESOLUTION(x) (x<<11)
+
+#define DTS_DFLT_CLOCK(x) (x<<19)
+
+/* F/W File Version corresponding to S/W Releases */
+enum _FW_FILE_VER {
+ /* S/W release: 02.04.02 F/W release 2.12.2.0 */
+ BC_FW_VER_020402 = ((12<<16) | (2<<8) | (0))
+};
+
+/*------------------------------------------------------*
+ * Stream Types for DtsOpenDecoder() *
+ *------------------------------------------------------*/
+enum _DtsOpenDecStreamTypes {
+ BC_STREAM_TYPE_ES = 0,
+ BC_STREAM_TYPE_PES = 1,
+ BC_STREAM_TYPE_TS = 2,
+ BC_STREAM_TYPE_ES_TSTAMP = 6,
+};
+
+/*------------------------------------------------------*
+ * Video Algorithms for DtsSetVideoParams() *
+ *------------------------------------------------------*/
+enum _DtsSetVideoParamsAlgo {
+ BC_VID_ALGO_H264 = 0,
+ BC_VID_ALGO_MPEG2 = 1,
+ BC_VID_ALGO_VC1 = 4,
+ BC_VID_ALGO_DIVX = 6,
+ BC_VID_ALGO_VC1MP = 7,
+};
+
+/*------------------------------------------------------*
+ * MPEG Extension to the PPB *
+ *------------------------------------------------------*/
+#define BC_MPEG_VALID_PANSCAN (1)
+
+typedef struct _BC_PIB_EXT_MPEG {
+ uint32_t valid;
+ /* Always valid, defaults to picture size if no
+ * sequence display extension in the stream. */
+ uint32_t display_horizontal_size;
+ uint32_t display_vertical_size;
+
+ /* MPEG_VALID_PANSCAN
+ * Offsets are a copy values from the MPEG stream. */
+ uint32_t offset_count;
+ int32_t horizontal_offset[3];
+ int32_t vertical_offset[3];
+
+} BC_PIB_EXT_MPEG;
+
+/*------------------------------------------------------*
+ * H.264 Extension to the PPB *
+ *------------------------------------------------------*/
+/* Bit definitions for 'other.h264.valid' field */
+#define H264_VALID_PANSCAN (1)
+#define H264_VALID_SPS_CROP (2)
+#define H264_VALID_VUI (4)
+
+typedef struct _BC_PIB_EXT_H264 {
+ /* 'valid' specifies which fields (or sets of
+ * fields) below are valid. If the corresponding
+ * bit in 'valid' is NOT set then that field(s)
+ * is (are) not initialized. */
+ uint32_t valid;
+
+ /* H264_VALID_PANSCAN */
+ uint32_t pan_scan_count;
+ int32_t pan_scan_left[3];
+ int32_t pan_scan_right[3];
+ int32_t pan_scan_top[3];
+ int32_t pan_scan_bottom[3];
+
+ /* H264_VALID_SPS_CROP */
+ int32_t sps_crop_left;
+ int32_t sps_crop_right;
+ int32_t sps_crop_top;
+ int32_t sps_crop_bottom;
+
+ /* H264_VALID_VUI */
+ uint32_t chroma_top;
+ uint32_t chroma_bottom;
+
+} BC_PIB_EXT_H264;
+
+/*------------------------------------------------------*
+ * VC1 Extension to the PPB *
+ *------------------------------------------------------*/
+#define VC1_VALID_PANSCAN (1)
+
+typedef struct _BC_PIB_EXT_VC1 {
+ uint32_t valid;
+
+ /* Always valid, defaults to picture size if no
+ * sequence display extension in the stream. */
+ uint32_t display_horizontal_size;
+ uint32_t display_vertical_size;
+
+ /* VC1 pan scan windows */
+ uint32_t num_panscan_windows;
+ int32_t ps_horiz_offset[4];
+ int32_t ps_vert_offset[4];
+ int32_t ps_width[4];
+ int32_t ps_height[4];
+
+} BC_PIB_EXT_VC1;
+
+
+/*------------------------------------------------------*
+ * Picture Information Block *
+ *------------------------------------------------------*/
+#if defined(__LINUX_USER__)
+/* Values for 'pulldown' field. '0' means no pulldown information
+ * was present for this picture. */
+enum {
+ vdecNoPulldownInfo = 0,
+ vdecTop = 1,
+ vdecBottom = 2,
+ vdecTopBottom = 3,
+ vdecBottomTop = 4,
+ vdecTopBottomTop = 5,
+ vdecBottomTopBottom = 6,
+ vdecFrame_X2 = 7,
+ vdecFrame_X3 = 8,
+ vdecFrame_X1 = 9,
+ vdecFrame_X4 = 10,
+};
+
+/* Values for the 'frame_rate' field. */
+enum {
+ vdecFrameRateUnknown = 0,
+ vdecFrameRate23_97,
+ vdecFrameRate24,
+ vdecFrameRate25,
+ vdecFrameRate29_97,
+ vdecFrameRate30,
+ vdecFrameRate50,
+ vdecFrameRate59_94,
+ vdecFrameRate60,
+ vdecFrameRate14_985,
+ vdecFrameRate7_496,
+};
+
+/* Values for the 'aspect_ratio' field. */
+enum {
+ vdecAspectRatioUnknown = 0,
+ vdecAspectRatioSquare,
+ vdecAspectRatio12_11,
+ vdecAspectRatio10_11,
+ vdecAspectRatio16_11,
+ vdecAspectRatio40_33,
+ vdecAspectRatio24_11,
+ vdecAspectRatio20_11,
+ vdecAspectRatio32_11,
+ vdecAspectRatio80_33,
+ vdecAspectRatio18_11,
+ vdecAspectRatio15_11,
+ vdecAspectRatio64_33,
+ vdecAspectRatio160_99,
+ vdecAspectRatio4_3,
+ vdecAspectRatio16_9,
+ vdecAspectRatio221_1,
+ vdecAspectRatioOther = 255,
+};
+
+/* Values for the 'colour_primaries' field. */
+enum {
+ vdecColourPrimariesUnknown = 0,
+ vdecColourPrimariesBT709,
+ vdecColourPrimariesUnspecified,
+ vdecColourPrimariesReserved,
+ vdecColourPrimariesBT470_2M = 4,
+ vdecColourPrimariesBT470_2BG,
+ vdecColourPrimariesSMPTE170M,
+ vdecColourPrimariesSMPTE240M,
+ vdecColourPrimariesGenericFilm,
+};
+
+enum {
+ vdecRESOLUTION_CUSTOM = 0x00000000, /* custom */
+ vdecRESOLUTION_480i = 0x00000001, /* 480i */
+ vdecRESOLUTION_1080i = 0x00000002, /* 1080i (1920x1080, 60i) */
+ vdecRESOLUTION_NTSC = 0x00000003, /* NTSC (720x483, 60i) */
+ vdecRESOLUTION_480p = 0x00000004, /* 480p (720x480, 60p) */
+ vdecRESOLUTION_720p = 0x00000005, /* 720p (1280x720, 60p) */
+ vdecRESOLUTION_PAL1 = 0x00000006, /* PAL_1 (720x576, 50i) */
+ vdecRESOLUTION_1080i25 = 0x00000007, /* 1080i25 (1920x1080, 50i) */
+ vdecRESOLUTION_720p50 = 0x00000008, /* 720p50 (1280x720, 50p) */
+ vdecRESOLUTION_576p = 0x00000009, /* 576p (720x576, 50p) */
+ vdecRESOLUTION_1080i29_97 = 0x0000000A, /* 1080i (1920x1080, 59.94i) */
+ vdecRESOLUTION_720p59_94 = 0x0000000B, /* 720p (1280x720, 59.94p) */
+ vdecRESOLUTION_SD_DVD = 0x0000000C, /* SD DVD (720x483, 60i) */
+ vdecRESOLUTION_480p656 = 0x0000000D, /* 480p (720x480, 60p), output bus width 8 bit, clock 74.25MHz */
+ vdecRESOLUTION_1080p23_976 = 0x0000000E, /* 1080p23_976 (1920x1080, 23.976p) */
+ vdecRESOLUTION_720p23_976 = 0x0000000F, /* 720p23_976 (1280x720p, 23.976p) */
+ vdecRESOLUTION_240p29_97 = 0x00000010, /* 240p (1440x240, 29.97p ) */
+ vdecRESOLUTION_240p30 = 0x00000011, /* 240p (1440x240, 30p) */
+ vdecRESOLUTION_288p25 = 0x00000012, /* 288p (1440x288p, 25p) */
+ vdecRESOLUTION_1080p29_97 = 0x00000013, /* 1080p29_97 (1920x1080, 29.97p) */
+ vdecRESOLUTION_1080p30 = 0x00000014, /* 1080p30 (1920x1080, 30p) */
+ vdecRESOLUTION_1080p24 = 0x00000015, /* 1080p24 (1920x1080, 24p) */
+ vdecRESOLUTION_1080p25 = 0x00000016, /* 1080p25 (1920x1080, 25p) */
+ vdecRESOLUTION_720p24 = 0x00000017, /* 720p24 (1280x720, 25p) */
+ vdecRESOLUTION_720p29_97 = 0x00000018, /* 720p29.97 (1280x720, 29.97p) */
+ vdecRESOLUTION_480p23_976 = 0x00000019, /* 480p23.976 (720*480, 23.976) */
+ vdecRESOLUTION_480p29_97 = 0x0000001A, /* 480p29.976 (720*480, 29.97p) */
+ vdecRESOLUTION_576p25 = 0x0000001B, /* 576p25 (720*576, 25p) */
+ /* For Zero Frame Rate */
+ vdecRESOLUTION_480p0 = 0x0000001C, /* 480p (720x480, 0p) */
+ vdecRESOLUTION_480i0 = 0x0000001D, /* 480i (720x480, 0i) */
+ vdecRESOLUTION_576p0 = 0x0000001E, /* 576p (720x576, 0p) */
+ vdecRESOLUTION_720p0 = 0x0000001F, /* 720p (1280x720, 0p) */
+ vdecRESOLUTION_1080p0 = 0x00000020, /* 1080p (1920x1080, 0p) */
+ vdecRESOLUTION_1080i0 = 0x00000021, /* 1080i (1920x1080, 0i) */
+};
+
+/* Bit definitions for 'flags' field */
+#define VDEC_FLAG_EOS (0x0004)
+
+#define VDEC_FLAG_FRAME (0x0000)
+#define VDEC_FLAG_FIELDPAIR (0x0008)
+#define VDEC_FLAG_TOPFIELD (0x0010)
+#define VDEC_FLAG_BOTTOMFIELD (0x0018)
+
+#define VDEC_FLAG_PROGRESSIVE_SRC (0x0000)
+#define VDEC_FLAG_INTERLACED_SRC (0x0020)
+#define VDEC_FLAG_UNKNOWN_SRC (0x0040)
+
+#define VDEC_FLAG_BOTTOM_FIRST (0x0080)
+#define VDEC_FLAG_LAST_PICTURE (0x0100)
+
+#define VDEC_FLAG_PICTURE_META_DATA_PRESENT (0x40000)
+
+#endif /* __LINUX_USER__ */
+
+typedef struct _BC_PIC_INFO_BLOCK {
+ /* Common fields. */
+ uint64_t timeStamp; /* Timestamp */
+ uint32_t picture_number; /* Ordinal display number */
+ uint32_t width; /* pixels */
+ uint32_t height; /* pixels */
+ uint32_t chroma_format; /* 0x420, 0x422 or 0x444 */
+ uint32_t pulldown;
+ uint32_t flags;
+ uint32_t frame_rate;
+ uint32_t aspect_ratio;
+ uint32_t colour_primaries;
+ uint32_t picture_meta_payload;
+ uint32_t sess_num;
+ uint32_t ycom;
+ uint32_t custom_aspect_ratio_width_height;
+ uint32_t n_drop; /* number of non-reference frames remaining to be dropped */
+
+ /* Protocol-specific extensions. */
+ union {
+ BC_PIB_EXT_H264 h264;
+ BC_PIB_EXT_MPEG mpeg;
+ BC_PIB_EXT_VC1 vc1;
+ } other;
+
+} BC_PIC_INFO_BLOCK, *PBC_PIC_INFO_BLOCK;
+
+/*------------------------------------------------------*
+ * ProcOut Info *
+ *------------------------------------------------------*/
+/* Optional flags for ProcOut Interface.*/
+enum _POUT_OPTIONAL_IN_FLAGS_{
+ /* Flags from App to Device */
+ BC_POUT_FLAGS_YV12 = 0x01, /* Copy Data in YV12 format */
+ BC_POUT_FLAGS_STRIDE = 0x02, /* Stride size is valid. */
+ BC_POUT_FLAGS_SIZE = 0x04, /* Take size information from Application */
+ BC_POUT_FLAGS_INTERLACED = 0x08, /* copy only half the bytes */
+ BC_POUT_FLAGS_INTERLEAVED = 0x10, /* interleaved frame */
+ BC_POUT_FLAGS_STRIDE_UV = 0x20, /* Stride size is valid (for UV buffers). */
+ BC_POUT_FLAGS_MODE = 0x40, /* Take output mode from Application, overrides YV12 flag if on */
+
+ /* Flags from Device to APP */
+ BC_POUT_FLAGS_FMT_CHANGE = 0x10000, /* Data is not VALID when this flag is set */
+ BC_POUT_FLAGS_PIB_VALID = 0x20000, /* PIB Information valid */
+ BC_POUT_FLAGS_ENCRYPTED = 0x40000, /* Data is encrypted. */
+ BC_POUT_FLAGS_FLD_BOT = 0x80000, /* Bottom Field data */
+};
+
+//Decoder Capability
+enum DECODER_CAP_FLAGS
+{
+ BC_DEC_FLAGS_H264 = 0x01,
+ BC_DEC_FLAGS_MPEG2 = 0x02,
+ BC_DEC_FLAGS_VC1 = 0x04,
+ BC_DEC_FLAGS_M4P2 = 0x08, //MPEG-4 Part 2: Divx, Xvid etc.
+};
+
+#if defined(__KERNEL__) || defined(__LINUX_USER__)
+typedef BC_STATUS(*dts_pout_callback)(void *shnd, uint32_t width, uint32_t height, uint32_t stride, void *pOut);
+#else
+typedef BC_STATUS(*dts_pout_callback)(void *shnd, uint32_t width, uint32_t height, uint32_t stride, struct _BC_DTS_PROC_OUT *pOut);
+#endif
+
+/* Line 21 Closed Caption */
+/* User Data */
+#define MAX_UD_SIZE 1792 /* 1920 - 128 */
+
+typedef struct _BC_DTS_PROC_OUT {
+ uint8_t *Ybuff; /* Caller Supplied buffer for Y data */
+ uint32_t YbuffSz; /* Caller Supplied Y buffer size */
+ uint32_t YBuffDoneSz; /* Transferred Y datasize */
+
+ uint8_t *UVbuff; /* Caller Supplied buffer for UV data */
+ uint32_t UVbuffSz; /* Caller Supplied UV buffer size */
+ uint32_t UVBuffDoneSz; /* Transferred UV data size */
+
+ uint32_t StrideSz; /* Caller supplied Stride Size */
+ uint32_t PoutFlags; /* Call IN Flags */
+
+ uint32_t discCnt; /* Picture discontinuity count */
+
+ BC_PIC_INFO_BLOCK PicInfo; /* Picture Information Block Data */
+
+ /* Line 21 Closed Caption */
+ /* User Data */
+ uint32_t UserDataSz;
+ uint8_t UserData[MAX_UD_SIZE];
+
+ void *hnd;
+ dts_pout_callback AppCallBack;
+ uint8_t DropFrames;
+ uint8_t b422Mode; /* Picture output Mode */
+ uint8_t bPibEnc; /* PIB encrypted */
+ uint8_t bRevertScramble;
+ uint32_t StrideSzUV; /* Caller supplied Stride Size */
+
+} BC_DTS_PROC_OUT;
+
+typedef struct _BC_DTS_STATUS {
+ uint8_t ReadyListCount; /* Number of frames in ready list (reported by driver) */
+ uint8_t FreeListCount; /* Number of frame buffers free. (reported by driver) */
+ uint8_t PowerStateChange; /* Number of active state power transitions (reported by driver) */
+ uint8_t reserved_[1];
+
+ uint32_t FramesDropped; /* Number of frames dropped. (reported by DIL) */
+ uint32_t FramesCaptured; /* Number of frames captured. (reported by DIL) */
+ uint32_t FramesRepeated; /* Number of frames repeated. (reported by DIL) */
+
+ uint32_t InputCount; /* Times compressed video has been sent to the HW.
+ * i.e. Successful DtsProcInput() calls (reported by DIL) */
+ uint64_t InputTotalSize; /* Amount of compressed video that has been sent to the HW.
+ * (reported by DIL) */
+ uint32_t InputBusyCount; /* Times compressed video has attempted to be sent to the HW
+ * but the input FIFO was full. (reported by DIL) */
+
+ uint32_t PIBMissCount; /* Amount of times a PIB is invalid. (reported by DIL) */
+
+ uint32_t cpbEmptySize; /* supported only for H.264, specifically changed for
+ * SingleThreadedAppMode. Report size of CPB buffer available.
+ * Reported by DIL */
+ uint64_t NextTimeStamp; /* TimeStamp of the next picture that will be returned
+ * by a call to ProcOutput. Added for SingleThreadedAppMode.
+ * Reported back from the driver */
+ uint8_t TxBufData;
+
+ uint8_t reserved__[3];
+
+ uint32_t picNumFlags; /* Picture number and flags of the next picture to be delivered from the driver */
+
+ uint8_t reserved___[8];
+
+} BC_DTS_STATUS;
+
+#define BC_SWAP32(_v) \
+ ((((_v) & 0xFF000000)>>24)| \
+ (((_v) & 0x00FF0000)>>8)| \
+ (((_v) & 0x0000FF00)<<8)| \
+ (((_v) & 0x000000FF)<<24))
+
+#define WM_AGENT_TRAYICON_DECODER_OPEN 10001
+#define WM_AGENT_TRAYICON_DECODER_CLOSE 10002
+#define WM_AGENT_TRAYICON_DECODER_START 10003
+#define WM_AGENT_TRAYICON_DECODER_STOP 10004
+#define WM_AGENT_TRAYICON_DECODER_RUN 10005
+#define WM_AGENT_TRAYICON_DECODER_PAUSE 10006
+
+#define MAX_COLOR_SPACES 3
+
+typedef enum _BC_OUTPUT_FORMAT {
+ MODE420 = 0x0,
+ MODE422_YUY2 = 0x1,
+ MODE422_UYVY = 0x2,
+ OUTPUT_MODE420 = 0x0,
+ OUTPUT_MODE422_YUY2 = 0x1,
+ OUTPUT_MODE422_UYVY = 0x2,
+ OUTPUT_MODE420_NV12 = 0x0,
+ OUTPUT_MODE_INVALID = 0xFF,
+} BC_OUTPUT_FORMAT;
+
+typedef struct _BC_COLOR_SPACES_ {
+ BC_OUTPUT_FORMAT OutFmt[MAX_COLOR_SPACES];
+ uint16_t Count;
+} BC_COLOR_SPACES;
+
+
+typedef enum _BC_CAPS_FLAGS_ {
+ PES_CONV_SUPPORT = 1, /*Support PES Conversion*/
+ MULTIPLE_DECODE_SUPPORT = 2 /*Support multiple stream decode*/
+} BC_CAPS_FLAGS;
+
+typedef struct _BC_HW_CAPABILITY_ {
+ BC_CAPS_FLAGS flags;
+ BC_COLOR_SPACES ColorCaps;
+ void* Reserved1; /* Expansion Of API */
+
+ //Decoder Capability
+ uint32_t DecCaps; //DECODER_CAP_FLAGS
+} BC_HW_CAPS, *PBC_HW_CAPS;
+
+typedef struct _BC_SCALING_PARAMS_ {
+ uint32_t sWidth;
+ uint32_t sHeight;
+ uint32_t DNR;
+ uint32_t Reserved1; /*Expansion Of API*/
+ uint8_t *Reserved2; /*Expansion OF API*/
+ uint32_t Reserved3; /*Expansion Of API*/
+ uint8_t *Reserved4; /*Expansion Of API*/
+
+} BC_SCALING_PARAMS, *PBC_SCALING_PARAMS;
+
+typedef enum _BC_MEDIA_SUBTYPE_ {
+ BC_MSUBTYPE_INVALID = 0,
+ BC_MSUBTYPE_MPEG1VIDEO,
+ BC_MSUBTYPE_MPEG2VIDEO,
+ BC_MSUBTYPE_H264,
+ BC_MSUBTYPE_WVC1,
+ BC_MSUBTYPE_WMV3,
+ BC_MSUBTYPE_AVC1,
+ BC_MSUBTYPE_WMVA,
+ BC_MSUBTYPE_VC1,
+ BC_MSUBTYPE_DIVX,
+ BC_MSUBTYPE_DIVX311,
+ BC_MSUBTYPE_OTHERS /*Types to facilitate PES conversion*/
+} BC_MEDIA_SUBTYPE;
+
+typedef struct _BC_INPUT_FORMAT_ {
+ BOOL FGTEnable; /*Enable processing of FGT SEI*/
+ BOOL MetaDataEnable; /*Enable retrieval of picture metadata to be sent to video pipeline.*/
+ BOOL Progressive; /*Instruct decoder to always try to send back progressive
+ frames. If input content is 1080p, the decoder will
+ ignore pull-down flags and always give 1080p output.
+ If 1080i content is processed, the decoder will return
+ 1080i data. When this flag is not set, the decoder will
+ use pull-down information in the input stream to decide
+ the decoded data format.*/
+ uint32_t OptFlags; /*In this field bits 0:3 are used pass default frame rate, bits 4:5 are for operation mode
+ (used to indicate Blu-ray mode to the decoder) and bit 6 is for the flag mpcOutPutMaxFRate
+ which when set tells the FW to output at the max rate for the resolution and ignore the
+ frame rate determined from the stream. Bit 7 is set to indicate that this is single threaded
+ mode and the driver will be peeked to get timestamps ahead of time*/
+ BC_MEDIA_SUBTYPE mSubtype; /* Video Media Type*/
+ uint32_t width;
+ uint32_t height;
+ uint32_t startCodeSz; /*Start code size for H264 clips*/
+ uint8_t *pMetaData; /*Metadata buffer that is used to pass sequence header*/
+ uint32_t metaDataSz; /*Metadata size*/
+ uint8_t bEnableScaling;
+ BC_SCALING_PARAMS ScalingParams;
+} BC_INPUT_FORMAT;
+
+typedef struct _BC_INFO_CRYSTAL_ {
+ uint8_t device;
+ union {
+ struct {
+ uint32_t dilRelease:8;
+ uint32_t dilMajor:8;
+ uint32_t dilMinor:16;
+ };
+ uint32_t version;
+ } dilVersion;
+
+ union {
+ struct {
+ uint32_t drvRelease:4;
+ uint32_t drvMajor:8;
+ uint32_t drvMinor:12;
+ uint32_t drvBuild:8;
+ };
+ uint32_t version;
+ } drvVersion;
+
+ union {
+ struct {
+ uint32_t fwRelease:4;
+ uint32_t fwMajor:8;
+ uint32_t fwMinor:12;
+ uint32_t fwBuild:8;
+ };
+ uint32_t version;
+ } fwVersion;
+
+ uint32_t Reserved1; // For future expansion
+ uint32_t Reserved2; // For future expansion
+} BC_INFO_CRYSTAL, *PBC_INFO_CRYSTAL;
+
+#endif /* _BC_DTS_DEFS_H_ */
diff --git a/tools/darwin/depends/libcrystalhd/libcrystalhd/bc_dts_types.h b/tools/darwin/depends/libcrystalhd/libcrystalhd/bc_dts_types.h
new file mode 100644
index 0000000000..a0b9ca52ad
--- /dev/null
+++ b/tools/darwin/depends/libcrystalhd/libcrystalhd/bc_dts_types.h
@@ -0,0 +1,68 @@
+/********************************************************************
+ * Copyright(c) 2006-2009 Broadcom Corporation.
+ *
+ * Name: bc_dts_types.h
+ *
+ * Description: Data types
+ *
+ * AU
+ *
+ * HISTORY:
+ *
+ ********************************************************************
+ * This header is free software: you can redistribute it 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.
+ *
+ * This header is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this header. If not, see <http://www.gnu.org/licenses/>.
+ *******************************************************************/
+
+#ifndef _BC_DTS_TYPES_H_
+#define _BC_DTS_TYPES_H_
+
+#ifdef __LINUX_USER__ /* Don't include these for KERNEL.. */
+#include <stdint.h>
+#endif
+
+#ifndef PVOID
+typedef void *PVOID;
+#endif
+
+#ifndef BOOL
+typedef int BOOL;
+#endif
+
+#ifdef __LINUX_USER__ /* Don't include these for KERNEL */
+typedef uint32_t ULONG;
+typedef int32_t LONG;
+typedef void *HANDLE;
+#ifndef VOID
+typedef void VOID;
+#endif
+typedef void *LPVOID;
+typedef uint32_t DWORD;
+typedef uint32_t UINT32;
+typedef uint32_t *LPDWORD;
+typedef unsigned char *PUCHAR;
+
+#ifndef TRUE
+ #define TRUE 1
+#endif
+
+#ifndef FALSE
+ #define FALSE 0
+#endif
+
+#else /* !__LINUX_USER__ */
+
+/* For Kernel usage.. */
+typedef bool bc_bool_t;
+#endif /* __LINUX_USER__ */
+
+#endif
+
diff --git a/tools/darwin/depends/libcrystalhd/libcrystalhd/libcrystalhd_if.h b/tools/darwin/depends/libcrystalhd/libcrystalhd/libcrystalhd_if.h
new file mode 100644
index 0000000000..45fa7a63f8
--- /dev/null
+++ b/tools/darwin/depends/libcrystalhd/libcrystalhd/libcrystalhd_if.h
@@ -0,0 +1,1515 @@
+/*****************************************************************************
+ * Copyright(c) 2006-2009 Broadcom Corporation.
+ *
+ * Name: libcrystalhd_if.h
+ *
+ * Description: Device Interface Library API.
+ *
+ * AU
+ *
+ * HISTORY:
+ *
+ *****************************************************************************
+ *
+ * This file is part of libcrystalhd.
+ *
+ * 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.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ *
+ ****************************************************************************/
+
+#ifndef _BCM_LDIL_IF_H_
+#define _BCM_LDIL_IF_H_
+
+#include "bc_dts_defs.h"
+
+#define FLEA_MAX_TRICK_MODE_SPEED 6
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*****************************************************************************
+******************************************************************************
+
+ Theory of operation
+
+
+ The Device Interface Library (DIL) allows application level code, such
+as a DirectShow filter, to access the Broadcom CrystalHD decoder driver to
+provide hardware decoding for MPEG-2, H.264 (AVC) and VC-1 streams.
+
+ In the Microsoft DirectShow system, the overall system graph would look
+like the following:
+
++--------+ +---------------+ +---------------+ +--------------------+
+| Source |->| Demultiplexer |->| Audio decoder |->| DirectSound Device |
++--------+ +---------------+ +---------------+ +--------------------+
+ |
+ | +-------------------------+ +----------------+
+ +->| Broadcom decoder filter |->| Video Renderer |
+ +-------------------------+ +----------------+
+ | |
+ +----------------+
+ | Broadcom DIL |
+ +----------------+
+ | |
+ +-----------------+
+ | Broadcom Driver |
+ +-----------------+
+
+ From the view of the caller, the DIL will accept compressed video streams
+and will output decoded video frames or fields to seperate Y and UV buffers.
+The DIL is responsible solely for decoding video and has no responsibilities
+for audio nor for rendering, as shown in the above diagram. Audio/video
+sychronization is assisted by feeding the DIL with timestamps so that it
+may pass those timestamps along with the decoded video. The timestamped
+output video will then be presented at the appropriate time by the renderer.
+
+A minimal implementation would be:
+
+ HANDLE hBRCMhandle;
+ uint8_t input_buffer[INPUT_SIZE];
+ uint8_t y_output_buffer[WIDTH*HEIGHT];
+ uint8_t uv_output_buffer[WIDTH*HEIGHT];
+ BC_DTS_PROC_OUT sProcOutData = { fill in your values here };
+ BC_PIC_INFO_BLOCK sPIB = { fill in your values here };
+
+ // Acquire handle for device.
+ DtsDeviceOpen(&hBRCMhandle, 0);
+
+ // Elemental stream.
+ DtsOpenDecoder(hBRCMhandle, 0);
+
+ // H.264, Enable FGT SEI, do not parse metadata, no forced progressive out
+ DtsSetVideoParams(hBRCMhandle,0,1,0,0,0);
+
+ // Tell decoder to wait for input from host. (PC)
+ DtsStartDecoder(hBRCMhandle);
+
+ // Input buffer address, input buffer size, no timestamp, Unencrypted
+ DtsProcInput(hBRCMhandle,input_buffer,sizeof(input_buffer),0,0);
+
+ // Tell PC to wait for data from decoder.
+ DtsStartCapture(hBRCMhandle);
+
+ // 16ms timeout, pass pointer to PIB then get the decoded picture.
+ DtsProcOutput(hBRCMhandle,16,&sPIB);
+
+ // Stop the decoder.
+ DtsStopDecoder(hBRCMhandle);
+
+ // Close the decoder
+ DtsCloseDecoder(hBRCMhandle);
+
+ // Release handle for device.
+ DtsDeviceClose(hBRCMhandle);
+
+******************************************************************************
+*****************************************************************************/
+
+#define DRVIFLIB_API
+
+/*****************************************************************************
+Function name:
+
+ DtsDeviceOpen
+
+Description:
+
+ Opens a handle to the decoder device that will be used to address that
+ unique instance of the decoder for all subsequent operations.
+
+ Must be called once when the application opens the decoder for use.
+
+Parameters:
+
+ *hDevice Pointer to device handle that will be filled in after the
+ device is successfully opened. [OUTPUT]
+
+ mode Controls the mode in which the device is opened.
+ Currently only mode 0 (normal playback) is supported.
+ All other values will return BC_STS_INV_ARG.
+
+Return:
+
+ Returns BC_STS_SUCCESS or error codes as appropriate.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsDeviceOpen(
+ HANDLE *hDevice,
+ uint32_t mode
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsDeviceClose
+
+Description:
+
+ Close the handle to the decoder device.
+
+ Must be called once when the application closes the decoder after use.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen
+
+Return:
+
+ Returns BC_STS_SUCCESS or error codes as appropriate.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsDeviceClose(
+ HANDLE hDevice
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsGetVersion
+
+Description:
+
+ Get version information from the driver as well as API library.
+ Version numbers are maintained in <Major>.<Minor>.<Revision> format.
+ Example ?01.23.4567
+
+ The device must have been previously opened for this call to succeed.
+ The individual components of the revision number are available as follows:
+
+ o Major (8 Bits) : Bit 31 ?24
+ o Minor (8 Bits) : Bit 23 ?16
+ o Revision (16 Bits) : Bits 15 ?Bit 0.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen
+ DrVer Device driver version
+ DilVer Driver interface library version
+
+Return:
+ The revision numbers from the currently loaded driver as well as the
+ driver interface API library.
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsGetVersion(
+ HANDLE hDevice,
+ uint32_t *DrVer,
+ uint32_t *DilVer
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsGetFWVersionFromFile
+
+Description:
+
+ Get version information from the Firmware Bin file when FW is not running
+ Version numbers in FW are maintained in <Major>.<Minor>.<Spl Revision> format.
+ the return value will be of the format:
+ (Major << 16) | (Minor<<8) | Spl_rev ?012345
+
+ The individual components of the revision number are available as follows:
+
+ o Major (8 Bits) : Bit 24 ?16
+ o Minor (8 Bits) : Bit 16 ?8
+ o Revision (16 Bits) : Bits 8 ?0.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen
+ StreamVer Stream FW version
+ DecVer VDEC FW version
+ Rsvd Reserved for future use
+
+Return:
+ The Stream FW Version umbers from the FW bin file in the install directory
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsGetFWVersionFromFile(
+ HANDLE hDevice,
+ uint32_t *StreamVer,
+ uint32_t *DecVer,
+ char *fname
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsGetFWVersion
+
+Description:
+
+ Get version information from the Firmware. The version information is obtained
+ from Bin file when the flag is not set. When the flag is set, a FW command is
+ issued to get the version numbers.
+ Version numbers in FW are maintained in <Major>.<Minor>.<Spl Revision> format.
+ Version number will be returned in the following format
+ (Major << 16) | (Minor<<8) | Spl_rev ?012345
+
+ The individual components of the revision number are available as follows:
+
+ o Major (8 Bits) : Bit 24 ?16
+ o Minor (8 Bits) : Bit 16 ?8
+ o Revision (16 Bits) : Bits 8 ?Bit 0.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen
+ StreamVer Stream FW version
+ DecVer VDEC FW version
+ HwVer Hardware version
+ Rsvd Reserved for future use
+ flag Reseved for future use
+
+Return:
+ The Stream FW Version number, VDEC FW version and Hwrev
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsGetFWVersion(
+ HANDLE hDevice,
+ uint32_t *StreamVer,
+ uint32_t *DecVer,
+ uint32_t *HwVer,
+ char *fname,
+ uint32_t flag
+ );
+
+
+/*****************************************************************************
+
+Function name:
+
+ DtsOpenDecoder
+
+Description:
+
+ Open the decoder for playback operations and sets appropriate parameters
+ for decode of input video data.
+
+ The device must have been previously opened for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ StreamType Currently supported streams are:
+ Elementary Streams with no timestamp management (0)
+ Transport Streams (2)
+ Elementary Streams with timestamp management (6)
+ All other values will return BC_STS_INV_ARG.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsOpenDecoder(
+ HANDLE hDevice,
+ uint32_t StreamType
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsCloseDecoder
+
+Description:
+
+ Close the decoder. No further pictures will be produced and all input
+ will be ignored.
+
+ The device must have been previously opened for this call to succeed.
+ This function closes the decoder and cleans up the state of the driver
+ and the library. All pending pictures will be dropped and all outstanding
+ transfers to and from the decoder will be aborted.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsCloseDecoder(
+ HANDLE hDevice
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsStartDecoder
+
+Description:
+
+ Start the actual processing of input data. Before this command the
+ decoder will ignore all of the presented input data.
+
+ DtsOpenDecoder must always be followed by a DtsStartDecoder for the
+ decoder to start processing input data. The device must have been
+ previously opened for this call to succeed. In addition the video
+ parameters for codec must have been set via a call to DtsSetVideoParams.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsStartDecoder(
+ HANDLE hDevice
+ );
+
+
+/*****************************************************************************
+
+Function name:
+
+ DtsSetVideoParams
+
+Description:
+
+ Sets various codec parameters that would be used by a subsequent call
+ to DtsStartDecoder.
+
+ DtsSetVideoParams must always be called before DtsStartDecoder for the
+ decoder to start processing input data. The device must have been
+ previously opened for this call to succeed.
+
+Parameters:
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ videoAlg Video Codec to be enabled to decode stream.
+ H.264 (0), VC-1 (4) and MPEG-2 (1) currently supported.
+ All other values will return BC_STS_INV_ARG
+ FGTEnable Enable processing of FGT SEI.
+ MetaDataEnable Enable retrieval of picture metadata to be sent to video
+ pipeline.
+ Progressive Instruct decoder to always try to send back progressive
+ frames. If input content is 1080p, the decoder will
+ ignore pull-down flags and always give 1080p output.
+ If 1080i content is processed, the decoder will return
+ 1080i data. When this flag is not set, the decoder will
+ use pull-down information in the input stream to decide
+ the decoded data format.
+ OptFlags In this field bits 0:3 are used pass default frame rate,
+ bits 4:5 are for operation mode (used to indicate Blu-ray
+ mode to the decoder) and bit 6 is for the flag mpcOutPutMaxFRate
+ which when set tells the FW to output at the max rate for the
+ resolution and ignore the frame rate determined from the
+ stream. Bit 7 is set to indicate that this is single threaded mode
+ and the driver will be peeked to get timestamps ahead of time.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsSetVideoParams(
+ HANDLE hDevice,
+ uint32_t videoAlg,
+ BOOL FGTEnable,
+ BOOL MetaDataEnable,
+ BOOL Progressive,
+ uint32_t OptFlags
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsSetInputFormat
+
+Description:
+
+ Sets input video's various parameters that would be used by a subsequent call
+ to DtsStartDecoder.
+
+ DtsSetInputFormat must always be called before DtsStartDecoder for the
+ decoder to start processing input data. The device must have been
+ previously opened for this call to succeed.
+
+Parameters:
+ hDevice Handle to device. This is obtained via a prior call to DtsDeviceOpen.
+ pInputFormat Pointer to the BC_INPUT_FORMAT data.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsSetInputFormat(
+ HANDLE hDevice,
+ BC_INPUT_FORMAT *pInputFormat
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsGetVideoParams
+
+Description:
+
+ Returns various codec parameters that would be used by a subsequent call
+ to DtsStartDecoder. These parameters are either default values or were
+ set via a prior call to DtsSetVideoParams
+
+ The device must have been previously opened for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ *videoAlg See DtsSetVideoParams. [OUTPUT]
+ *FGTEnable See DtsSetVideoParams. [OUTPUT]
+ *MetaDataEnable See DtsSetVideoParams. [OUTPUT]
+ *Progressive See DtsSetVideoParams. [OUTPUT]
+ Reserved This field is reserved for possible future expansion.
+ Set to 0.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsGetVideoParams(
+ HANDLE hDevice,
+ uint32_t *videoAlg,
+ BOOL *FGTEnable,
+ BOOL *MetaDataEnable,
+ BOOL *Progressive,
+ uint32_t Reserved
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsFormatChange
+
+Description:
+
+ Changes codec type and parameters.
+
+ The device must have been previously opened for this call to succeed.
+ This function should be used only for mid-stream format changes.
+ DtsStartDecoder must have been called before for this function to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ videoAlg Video Codec to be enabled to decode stream.
+ H.264 (0), VC-1 (4) and MPEG-2 (1) currently supported. All
+ other values will return BC_STS_INV_ARG
+ FGTEnable Enable processing of FGT SEI.
+ Progressive Instruct decoder to always try to send back progressive
+ frames. If input content is 1080p, the decoder will ignore
+ pull-down flags and always give 1080p output. If 1080i
+ content is processed, the decoder will return 1080i data.
+ When this flag is not set, the decoder will use pull-down
+ information in the input stream to decide the decoded data
+ format.
+ Reserved This field is reserved for possible future expansion.
+ Set to 0.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsFormatChange(
+ HANDLE hDevice,
+ uint32_t videoAlg,
+ BOOL FGTEnable,
+ BOOL MetaDataEnable,
+ BOOL Progressive,
+ uint32_t Reserved
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsStopDecoder
+
+Description:
+
+ Stop the decoder.
+
+ The device must have been previously opened for this call to succeed.
+ This function will clean up any pending operations and stop the decoder.
+ Internal state is still maintained and the decoder can be restarted.
+ Any pending pictures will be dropped.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsStopDecoder(
+ HANDLE hDevice
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsPauseDecoder
+
+Description:
+
+ Pause the decoder. The paused picture will be repeated by decoder.
+
+ The device must have been previously opened for this call to succeed.
+ In addition the decoder must have been started as well. If the decoder
+ is open but not started, this function will return BC_STS_DEC_NOT_STARTED.
+ If the decoder has not been opened this function will return
+ BC_STS_DEC_NOT_OPEN.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsPauseDecoder(
+ HANDLE hDevice
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsResumeDecoder
+
+Description:
+
+ Unpause the decoder from a previous paused condition.
+
+ The device must have been previously opened for this call to succeed.
+ If the decoder was not paused previously, this function will return
+ without affecting the decoder with a BC_STS_SUCCESS status. If the
+ decoder is open but not started, this function will return
+ BC_STS_DEC_NOT_STARTED.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsResumeDecoder(
+ HANDLE hDevice
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsSetVideoPID
+
+Description:
+
+ Sets the video PID in the input Transport Stream that the decoder
+ needs to process.
+
+ The device must have been previously opened for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ PID PID value that decoder needs to process.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsSetVideoPID(
+ HANDLE hDevice,
+ uint32_t pid
+ );
+
+
+/*****************************************************************************
+
+Function name:
+
+ StartCaptureImmidiate
+
+Description:
+
+ Instruct the driver to start capturing decoded frames for output.
+
+ The device must have been previously opened for this call to succeed.
+ This function must be called before the first call to DtsProcInput.
+ This function instructs the receive path in the driver to start waiting
+ for valid data to be presented from the decoder.
+
+Parameters:
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsStartCaptureImmidiate(
+ HANDLE hDevice,
+ uint32_t Reserved
+ );
+
+
+/*****************************************************************************
+
+Function name:
+
+ StartCapture
+
+Description:
+
+ Instruct the driver to start capturing decoded frames for output.
+
+ The device must have been previously opened for this call to succeed.
+ This function must be called before the first call to DtsProcInput.
+ This function instructs the receive path in the driver to start waiting
+ for valid data to be presented from the decoder.
+
+Parameters:
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsStartCapture(
+ HANDLE hDevice
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ FlushRxCapture
+
+Description:
+
+ ***This function is deprecated and is for temporary use only.***
+
+ Flush the driverís queue of pictures and stops the capture process. These
+ functions will be replaced with automatic Stop (End of Sequence) detection.
+
+ The device must have been previously opened for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsFlushRxCapture(
+ HANDLE hDevice,
+ BOOL bDiscardOnly
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsProcOutput
+
+Description:
+
+ Returns one decoded picture to the caller.
+
+ The device must have been previously opened for this call to succeed.
+
+ == NOTE ====
+ For PIB AND 100% output encryption/scrambling on Bcm LINK hardware
+ use ProcOutputNoCopy() Interace. This interface will not support
+ PIB encryption.
+
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ milliSecWait Timeout parameter. DtsProcOutput will fail is no picture
+ is received in this time.
+ *pOut This is a pointer to the BC_DTS_PROC_OUT structure that is
+ allocated by the caller. The decoded picture is returned
+ in this structure. This structure is described in the
+ data structures section. The actual data buffer to be
+ filled with the decoded data is allocated by the caller.
+ Data is copied from the decoder to the buffers before this
+ function returns. [INPUT/OUTPUT]
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsProcOutput(
+ HANDLE hDevice,
+ uint32_t milliSecWait,
+ BC_DTS_PROC_OUT *pOut
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsProcOutputNoCopy
+
+Description:
+
+ Returns one decoded picture to the caller. Functionality of this API()
+ is very similar to ProcOutPut() API. This API will not copy the video data
+ to caller's buffers but provides the source buffer pointers in pOut structure.
+
+ This is more secure and preferred method for BCM's Link hardware. The actual
+ format conversion/copy routines are provided as part of the Filter/Security
+ layer source code. Using this method, all the clear data handling will be
+ done by bcmDFilter or bcmSec layers which are expected to be in Player's
+ tamper resistant area.
+
+ == NOTE ====
+ 1) DtsReleaseOutputBuffs() interface must be called to release the buffers
+ back to DIL if return Status is BC_STS_SUCCESS.
+
+ 2) Only this interface supports PIB and full 100% output encryption/Scrambling.
+
+
+ The device must have been previously opened for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ milliSecWait Timeout parameter. DtsProcOoutput will fail is no picture
+ is received in this time.
+ *pOut This is a pointer to the BC_DTS_PROC_OUT structure that is
+ allocated by the caller. The decoded picture is returned
+ in this structure.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsProcOutputNoCopy(
+ HANDLE hDevice,
+ uint32_t milliSecWait,
+ BC_DTS_PROC_OUT *pOut
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsReleaseOutputBuffs
+
+Description:
+
+ Release Buffers acquired during ProcOutputNoCopy() interface.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ Reserved Reserved. Set to NULL.
+
+ fChange FALSE.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsReleaseOutputBuffs(
+ HANDLE hDevice,
+ PVOID Reserved,
+ BOOL fChange
+ );
+
+
+/*****************************************************************************
+
+Function name:
+
+ DtsProcInput
+
+Description:
+
+ Sends compressed (coded) data to the decoder for processing.
+
+ The device must have been previously opened for this call to succeed.
+ In addition, suitable keys must have been exchanged for decryption and
+ decode to be successful.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ pUserData Pointer to data buffer that holds the data to be transferred.
+ [INPUT]
+ sizeInBytes Size in Bytes of data available to be sent to the decoder for
+ processing.
+ Timestamp Optional timestamp information attached to the media sample
+ that is available in the buffer. If timestamp is present
+ (i.e. non-zero), then this will be reflected in the output
+ sample (picture) produced from the contents of this buffer.
+ Timestamp should be in units of 100 ns.
+ Encrypted Flag to indicate that the data transfer is not in the clear
+ and that the decoder needs to decrypt before it can decode
+ the data. Note that due to complexity, it is preferred that
+ the application writer uses the higher level
+ dts_pre_proc_input() call if encypted content will be sent.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsProcInput(
+ HANDLE hDevice,
+ uint8_t *pUserData,
+ uint32_t ulSizeInBytes,
+ uint64_t timeStamp,
+ BOOL encrypted
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsGetColorPrimaries
+
+Description:
+
+ Returns color primaries information from the stream being processed.
+
+ The device must have been previously opened for this call to succeed.
+ In addition at least one picture must have been successfully decoded and
+ returned back from the decoder.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ colorPrimaries Pointer to U32 to receive the color primaries information.
+ The values returned are described in the previous section
+ regarding the picture metadata. [OUTPUT]
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsGetColorPrimaries(
+ HANDLE hDevice,
+ uint32_t *colorPrimaries
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsFlushInput
+
+Description:
+
+ Flushes the current channel and causes the decoder to stop accessing input
+ data. Based on the flush mode parameter, the channel will be flushed from
+ the current point in the input data or from the current processing point.
+
+ The device must have been previously opened for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ Mode 0 Flush at the current input point. use to drain the
+ input FIFO . All the data that has been received will
+ be decoded.
+ 1 Flush at the current processing point. All the decoded
+ frames will be presented but no more data from the
+ input will be decoded.
+ 2 Flushes all the decoder buffers, input, decoded and
+ to be decoded.
+ 3 Cancels the pending TX Request from the DIL/driver
+ 4 Flushes all the decoder buffers, input, decoded and
+ to be decoded data. Also flushes the drivers buffers
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsFlushInput(
+ HANDLE hDevice,
+ uint32_t Mode
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsSetRateChange
+
+Description:
+
+ Sets the decoder playback speed and direction of playback.
+
+ The device must have been previously opened for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ rate Inverse of speed x 10000.
+ Examples:
+ 1/2x playback speed = 20000
+ 1x playback speed = 10000
+ 2x playback speed = 5000
+
+ direction Playback direction.
+ 0 Forward direction.
+ 1 Reverse direction.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsSetRateChange(
+ HANDLE hDevice,
+ uint32_t rate,
+ uint8_t direction
+ );
+
+
+//Set FF Rate for Catching Up
+/*****************************************************************************
+
+Function name:
+
+ DtsSetFFRate
+
+Description:
+
+ Sets the decoder playback FF speed
+
+ The device must have been previously opened for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ rate Inverse of speed x 10000.
+ Examples:
+ 1/2x playback speed = 20000
+ 1x playback speed = 10000
+ 2x playback speed = 5000
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsSetFFRate(
+ HANDLE hDevice,
+ uint32_t rate
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsSetSkipPictureMode
+
+Description:
+
+ This command sets the decoder to only decode selected picture types.
+
+ The device must have been previously opened for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+ SkipMode 0 IPB, All pictures are decoded.
+
+ 1 IP decoding, This mode skips all non reference pictures.
+
+ 2 I decoding, This mode skips all P/B pictures and only decodes
+ I pictures.
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsSetSkipPictureMode(
+ HANDLE hDevice,
+ uint32_t SkipMode
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsSetIFrameTrickMode
+
+Description:
+
+ This command sets the decoder to decode only I Frames for FF and FR.
+
+ Use this API for I Frame only trick mode play back in either direction. The
+ application/Up stream filter determines the speed of the playback by
+ means of Skip on the input compressed data.
+
+ The device must have been previously opened for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsSetIFrameTrickMode(
+ HANDLE hDevice
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsStepDecoder
+
+Description:
+
+ This function forwards one frame.
+
+ The device must have been opened must be in paused
+ state previously for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsStepDecoder(
+ HANDLE hDevice
+ );
+
+
+/*****************************************************************************
+
+Function name:
+
+ DtsIs422Supported
+
+Description:
+
+ This function returns whether 422 YUV mode is supported or not.
+
+ The device must have been opened previously for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ bSupported 1 - 422 is supported
+ 0 - 422 is not supported.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsIs422Supported(
+ HANDLE hDevice,
+ uint8_t *bSupported
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsSetColorSpace
+
+Description:
+
+ This function sets the output sample's color space.
+
+ The device must have been opened previously and must support 422 mode for
+ this call to succeed.
+
+ Use "DtsIs422Supported" to find whether 422 mode is supported.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ 422Mode Mode is defined by BC_OUTPUT_FORMAT as follows -
+ OUTPUT_MODE420 = 0x0,
+ OUTPUT_MODE422_YUY2 = 0x1,
+ OUTPUT_MODE422_UYVY = 0x2,
+ OUTPUT_MODE_INVALID = 0xFF
+ Valid values for this API are OUTPUT_MODE422_YUY2 and OUTPUT_MODE422_UYVY
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsSetColorSpace(
+ HANDLE hDevice,
+ BC_OUTPUT_FORMAT Mode422
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsSet422Mode
+
+Description:
+
+ This function sets the 422 mode to either YUY2 or UYVY.
+
+ The device must have been opened previously and must support 422 mode for
+ this call to succeed.
+
+ Use "DtsIs422Supported" to find whether 422 mode is supported.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+ 422Mode 0 - set the YUV mode to YUY2
+ 1 - set the YUV mode to UYVY
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsSet422Mode(
+ HANDLE hDevice,
+ uint8_t Mode422
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsGetDILPath
+
+Description:
+
+ This is a helper function to return DIL's Path.
+
+ The device must have been previously opened for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+ DilPath Buffer to hold DIL path info upto 256 bytes.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+
+DRVIFLIB_API BC_STATUS
+DtsGetDILPath(
+ HANDLE hDevice,
+ char *DilPath,
+ uint32_t size
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsDropPictures
+
+Description:
+
+ This command sets the decoder to skip one or more non-reference (B) pictures
+ in the input data stream. This is used for when the audio is ahead of
+ video and the application needs to cause video to move ahead to catch up.
+ Reference pictures are not skipped.
+
+ The device must have been previously opened for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+ Pictures The number of non-reference pictures to drop.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsDropPictures(
+ HANDLE hDevice,
+ uint32_t Pictures
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsGetDriverStatus
+
+Description:
+
+ This command returns various statistics related to the driver and DIL.
+
+ The device must have been previously opened for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+ *pStatus Pointer to BC_DTS_STATUS to receive driver status.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsGetDriverStatus(
+ HANDLE hDevice,
+ BC_DTS_STATUS *pStatus
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsGetCapabilities
+
+Description:
+
+ This command returns output format support and hardware capabilities.
+
+ The device must have been previously opened for this call to succeed.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+ pCapsBuffer Pointer to BC_HW_CAPS to receive HW Output capabilities.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsGetCapabilities (
+ HANDLE hDevice,
+ PBC_HW_CAPS pCapsBuffer
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsSetScaleParams
+
+Description:
+
+ This command sets hardware scaling parameters.
+
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+ pScaleParams Pointer to BC_SCALING_PARAMS to set hardware scaling parameters.
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsSetScaleParams (
+ HANDLE hDevice,
+ PBC_SCALING_PARAMS pScaleParams
+ );
+
+/*****************************************************************************
+
+Function name:
+
+ DtsIsEndOfStream
+
+Description:
+
+ This command returns whether the end of stream(EOS) is reaching.
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+ bEOS Pointer to uint8_t to indicate if EOS of not
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsIsEndOfStream(
+ HANDLE hDevice,
+ uint8_t* bEOS
+);
+
+/*****************************************************************************
+
+Function name:
+
+ DtsCrystalHDVersion
+
+Description:
+
+ This API returns hw and sw version information for Crystal HD solutions
+Parameters:
+
+ hDevice Handle to device. This is obtained via a prior call to
+ DtsDeviceOpen.
+
+ bCrystalInfo Pointer to structure to fill in with information
+
+ device = 0 for BCM70012, 1 for BCM70015
+
+Return:
+
+ BC_STS_SUCCESS will be returned on successful completion.
+
+*****************************************************************************/
+DRVIFLIB_API BC_STATUS
+DtsCrystalHDVersion(
+ HANDLE hDevice,
+ PBC_INFO_CRYSTAL bCrystalInfo
+);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/tools/darwin/depends/libcrystalhd/libcrystalhd/libcrystalhd_version.h b/tools/darwin/depends/libcrystalhd/libcrystalhd/libcrystalhd_version.h
new file mode 100644
index 0000000000..b640dac41a
--- /dev/null
+++ b/tools/darwin/depends/libcrystalhd/libcrystalhd/libcrystalhd_version.h
@@ -0,0 +1,80 @@
+/********************************************************************
+ * Copyright(c) 2006-2009 Broadcom Corporation.
+ *
+ * Name: libcrystalhd_version.h
+ *
+ * Description: Version numbering for the driver use.
+ *
+ * AU
+ *
+ * HISTORY:
+ *
+ ********************************************************************
+ * This header is free software: you can redistribute it 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.
+ *
+ * This header is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this header. If not, see <http://www.gnu.org/licenses/>.
+ *******************************************************************/
+
+#ifndef _BC_DTS_VERSION_LNX_
+#define _BC_DTS_VERSION_LNX_
+//
+// The version format that we are adopting is
+// MajorVersion.MinorVersion.Revision
+// This will be the same for all the components.
+//
+//
+#define STRINGIFY_VERSION(MAJ,MIN,REV) STRINGIFIED_VERSION(MAJ,MIN,REV)
+#define STRINGIFIED_VERSION(MAJ,MIN,REV) #MAJ "." #MIN "." #REV
+
+#define STRINGIFY_VERSION_W(MAJ,MIN,REV) STRINGIFIED_VERSION_W(MAJ,MIN,REV)
+#define STRINGIFIED_VERSION_W(MAJ,MIN,REV) #MAJ "." #MIN "." #REV
+
+//
+// Product Version number is:
+// x.y.z.a
+//
+// x = Major release. 1 = Dozer, 2 = Dozer + Link
+// y = Minor release. Should increase +1 per "real" release.
+// z = Branch release. 0 for main branch. This is +1 per branch release.
+// a = Build number +1 per candidate release. Reset to 0 every "real" release.
+//
+//
+// Enabling Check-In rules enforcement 08092007
+//
+#define INVALID_VERSION 0xFFFF
+
+/*========================== Common For All Components =================================*/
+#define BRCM_MAJOR_VERSION 3
+
+#define DRIVER_MAJOR_VERSION BRCM_MAJOR_VERSION
+#define DRIVER_MINOR_VERSION 6
+#define DRIVER_REVISION 0
+
+#define RC_FILE_VERSION STRINGIFY_VERSION(DRIVER_MAJOR_VERSION,DRIVER_MINOR_VERSION,DRIVER_REVISION) ".0"
+
+/*======================= Device Interface Library ========================*/
+#define DIL_MAJOR_VERSION BRCM_MAJOR_VERSION
+#define DIL_MINOR_VERSION 6
+#define DIL_REVISION 0
+
+#define DIL_RC_FILE_VERSION STRINGIFY_VERSION(DIL_MAJOR_VERSION,DIL_MINOR_VERSION,DIL_REVISION)
+
+/*========================== deconf utility ==============================*/
+#define DECONF_MAJOR_VERSION BRCM_MAJOR_VERSION
+#define DECONF_MINOR_VERSION 9
+#define DECONF_REVISION 18
+#define DECONF_RC_FILE_VERSION STRINGIFY_VERSION(DIL_MAJOR_VERSION,DIL_MINOR_VERSION,DIL_REVISION)
+
+/*========================== Firmware ==============================*/
+#define FW_MAJOR_VERSION BRCM_MAJOR_VERSION
+#define FW_MINOR_VERSION 60
+#define FW_REVISION 39
+
+#endif
diff --git a/tools/darwin/depends/libflac/Makefile b/tools/darwin/depends/libflac/Makefile
new file mode 100644
index 0000000000..ab2370a7ac
--- /dev/null
+++ b/tools/darwin/depends/libflac/Makefile
@@ -0,0 +1,40 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=flac
+VERSION=1.2.1
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --disable-asm-optimizations \
+ --disable-xmms-plugin \
+ --disable-cpplibs
+
+LIBDYLIB=$(SOURCE)/$(LIBNAME)/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libgcrypt/Makefile b/tools/darwin/depends/libgcrypt/Makefile
new file mode 100644
index 0000000000..4d9ee78f2d
--- /dev/null
+++ b/tools/darwin/depends/libgcrypt/Makefile
@@ -0,0 +1,41 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=libgcrypt
+VERSION=1.4.0
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.bz2
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX)
+
+LIBDYLIB=$(SOURCE)/.libs/libgcrypt.dylib
+
+CLEAN_FILES=$(ARCHIVE) $(SOURCE)
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); autoreconf -vif
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
+
diff --git a/tools/darwin/depends/libgpg-error/Makefile b/tools/darwin/depends/libgpg-error/Makefile
new file mode 100644
index 0000000000..a8a319ec1c
--- /dev/null
+++ b/tools/darwin/depends/libgpg-error/Makefile
@@ -0,0 +1,41 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=libgpg-error
+VERSION=1.10
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.bz2
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --with-libintl-prefix=$(PREFIX)/lib
+
+LIBDYLIB=$(SOURCE)/.libs/libgpg-error.dylib
+
+CLEAN_FILES=$(ARCHIVE) $(SOURCE)
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
+
diff --git a/tools/darwin/depends/liblzo2/01-liblzo2-only-build-lib.patch b/tools/darwin/depends/liblzo2/01-liblzo2-only-build-lib.patch
new file mode 100644
index 0000000000..f3d5960932
--- /dev/null
+++ b/tools/darwin/depends/liblzo2/01-liblzo2-only-build-lib.patch
@@ -0,0 +1,25 @@
+diff -ruN lzo-2.03.org/Makefile.am lzo-2.03/Makefile.am
+--- lzo-2.03.org/Makefile.am 2008-04-30 08:51:49.000000000 -0400
++++ lzo-2.03/Makefile.am 2010-10-29 12:38:51.000000000 -0400
+@@ -5,7 +5,7 @@
+
+ AUTOMAKE_OPTIONS = 1.9.6 gnu
+
+-SUBDIRS = include src lzotest examples tests minilzo
++SUBDIRS = include src
+
+ EXTRA_DIST = BUGS
+
+diff -ruN lzo-2.03.org/Makefile.in lzo-2.03/Makefile.in
+--- lzo-2.03.org/Makefile.in 2008-04-30 08:51:49.000000000 -0400
++++ lzo-2.03/Makefile.in 2010-10-29 12:56:42.000000000 -0400
+@@ -193,7 +193,7 @@
+ target_os = @target_os@
+ target_vendor = @target_vendor@
+ AUTOMAKE_OPTIONS = 1.9.6 gnu
+-SUBDIRS = include src lzotest examples tests minilzo
++SUBDIRS = include src
+ EXTRA_DIST = BUGS
+ all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
diff --git a/tools/darwin/depends/liblzo2/Makefile b/tools/darwin/depends/liblzo2/Makefile
new file mode 100644
index 0000000000..0dc8c8bd46
--- /dev/null
+++ b/tools/darwin/depends/liblzo2/Makefile
@@ -0,0 +1,39 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=lzo
+VERSION=2.03
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --enable-shared=yes
+
+LIBDYLIB=$(SOURCE)/src/.libs/lib$(LIBNAME)2.dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); patch -p1 < ../01-liblzo2-only-build-lib.patch
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libmad/01-libmad-pkgconfig.patch b/tools/darwin/depends/libmad/01-libmad-pkgconfig.patch
new file mode 100644
index 0000000000..0ac88acb84
--- /dev/null
+++ b/tools/darwin/depends/libmad/01-libmad-pkgconfig.patch
@@ -0,0 +1,117 @@
+diff -ruN libmad-0.15.1b.orig/Makefile.am libmad-0.15.1b/Makefile.am
+--- libmad-0.15.1b.orig/Makefile.am 2004-02-17 02:02:03.000000000 +0000
++++ libmad-0.15.1b/Makefile.am 2005-08-25 12:08:04.000000000 +0000
+@@ -33,9 +33,12 @@
+ minimad_INCLUDES =
+ minimad_LDADD = libmad.la
+
+-EXTRA_DIST = mad.h.sed \
++EXTRA_DIST = mad.h.sed mad.pc.in \
+ CHANGES COPYRIGHT CREDITS README TODO VERSION
+
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA= mad.pc
++
+ exported_headers = version.h fixed.h bit.h timer.h stream.h frame.h \
+ synth.h decoder.h
+
+diff -ruN libmad-0.15.1b.orig/Makefile.in libmad-0.15.1b/Makefile.in
+--- libmad-0.15.1b.orig/Makefile.in 2004-02-17 02:33:23.000000000 +0000
++++ libmad-0.15.1b/Makefile.in 2005-08-25 12:09:34.000000000 +0000
+@@ -14,6 +14,8 @@
+
+ @SET_MAKE@
+
++pkgconfigdir = $(libdir)/pkgconfig
++pkgconfig_DATA = mad.pc
+
+ SOURCES = $(libmad_la_SOURCES) $(EXTRA_libmad_la_SOURCES) $(minimad_SOURCES)
+
+@@ -43,7 +45,7 @@
+ $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/config.h.in $(srcdir)/libmad.list.in \
+ $(top_srcdir)/configure COPYING INSTALL TODO config.guess \
+- config.sub depcomp install-sh ltmain.sh missing mkinstalldirs
++ config.sub depcomp install-sh ltmain.sh missing mkinstalldirs mad.pc.in
+ subdir = .
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+ am__aclocal_m4_deps = $(top_srcdir)/configure.ac
+@@ -53,7 +55,7 @@
+ configure.lineno configure.status.lineno
+ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+ CONFIG_HEADER = config.h
+-CONFIG_CLEAN_FILES = libmad.list
++CONFIG_CLEAN_FILES = libmad.list mad.pc
+ am__installdirs = $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
+ libLTLIBRARIES_INSTALL = $(INSTALL)
+ LTLIBRARIES = $(lib_LTLIBRARIES)
+@@ -218,7 +220,7 @@
+ minimad_SOURCES = minimad.c
+ minimad_INCLUDES =
+ minimad_LDADD = libmad.la
+-EXTRA_DIST = mad.h.sed \
++EXTRA_DIST = mad.h.sed mad.pc.in \
+ CHANGES COPYRIGHT CREDITS README TODO VERSION
+
+ exported_headers = version.h fixed.h bit.h timer.h stream.h frame.h \
+@@ -298,6 +300,28 @@
+ rm -f stamp-h1
+ touch $@
+
++mad.pc: $(top_builddir)/config.status mad.pc.in
++ cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
++
++install-pkgconfigDATA: $(pkgconfig_DATA)
++ @$(NORMAL_INSTALL)
++ $(mkinstalldirs) $(DESTDIR)$(pkgconfigdir)
++ @list='$(pkgconfig_DATA)'; for p in $$list; do \
++ if test -f $(srcdir)/$$p; then \
++ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p"; \
++ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgconfigdir)/$$p; \
++ else if test -f $$p; then \
++ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p"; \
++ $(INSTALL_DATA) $$p $(DESTDIR)$(pkgconfigdir)/$$p; \
++ fi; fi; \
++ done
++
++uninstall-pkgconfigDATA:
++ @$(NORMAL_UNINSTALL)
++ list='$(pkgconfig_DATA)'; for p in $$list; do \
++ rm -f $(DESTDIR)$(pkgconfigdir)/$$p; \
++ done
++
+ distclean-hdr:
+ -rm -f config.h stamp-h1
+ libmad.list: $(top_builddir)/config.status $(srcdir)/libmad.list.in
+@@ -726,7 +750,7 @@
+
+ info-am:
+
+-install-data-am: install-includeHEADERS
++install-data-am: install-includeHEADERS install-pkgconfigDATA
+
+ install-exec-am: install-libLTLIBRARIES
+
+@@ -757,7 +781,7 @@
+ ps-am:
+
+ uninstall-am: uninstall-includeHEADERS uninstall-info-am \
+- uninstall-libLTLIBRARIES
++ uninstall-libLTLIBRARIES install-pkgconfigDATA
+
+ uninstall-info: uninstall-info-recursive
+
+diff -ruN libmad-0.15.1b.orig/mad.pc.in libmad-0.15.1b/mad.pc.in
+--- libmad-0.15.1b.orig/mad.pc.in 1970-01-01 00:00:00.000000000 +0000
++++ libmad-0.15.1b/mad.pc.in 2005-08-25 12:08:04.000000000 +0000
+@@ -0,0 +1,10 @@
++prefix=@prefix@
++exec_prefix=@exec_prefix@
++libdir=@libdir@
++includedir=@includedir@
++
++Name: MAD
++Description: libmad - MPEG audio decoder library
++Version: @VERSION@
++Libs: -L${libdir} -lmad
++Cflags:
diff --git a/tools/darwin/depends/libmad/Makefile b/tools/darwin/depends/libmad/Makefile
new file mode 100644
index 0000000000..88992d1fcf
--- /dev/null
+++ b/tools/darwin/depends/libmad/Makefile
@@ -0,0 +1,39 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=libmad
+VERSION=0.15.1b
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --enable-fpm=default
+
+LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); patch -p1 < ../01-libmad-pkgconfig.patch
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libmicrohttpd/Makefile b/tools/darwin/depends/libmicrohttpd/Makefile
new file mode 100644
index 0000000000..4a9894d4b6
--- /dev/null
+++ b/tools/darwin/depends/libmicrohttpd/Makefile
@@ -0,0 +1,38 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=libmicrohttpd
+VERSION=0.4.6
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --with-libgcrypt-prefix=/dev/null
+
+LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libmodplug/Makefile b/tools/darwin/depends/libmodplug/Makefile
new file mode 100644
index 0000000000..034ae123dd
--- /dev/null
+++ b/tools/darwin/depends/libmodplug/Makefile
@@ -0,0 +1,37 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=libmodplug
+VERSION=0.8.7
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX)
+
+LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libmpeg2/01-libmpeg2-add-asm-leading-underscores.patch b/tools/darwin/depends/libmpeg2/01-libmpeg2-add-asm-leading-underscores.patch
new file mode 100644
index 0000000000..532e53af4e
--- /dev/null
+++ b/tools/darwin/depends/libmpeg2/01-libmpeg2-add-asm-leading-underscores.patch
@@ -0,0 +1,48 @@
+diff -ruN libmpeg2-0.5.1.org/libmpeg2/motion_comp_arm_s.S libmpeg2-0.5.1/libmpeg2/motion_comp_arm_s.S
+--- libmpeg2-0.5.1.org/libmpeg2/motion_comp_arm_s.S 2008-07-09 15:16:05.000000000 -0400
++++ libmpeg2-0.5.1/libmpeg2/motion_comp_arm_s.S 2010-10-29 13:33:02.000000000 -0400
+@@ -23,8 +23,8 @@
+
+ @ ----------------------------------------------------------------
+ .align
+- .global MC_put_o_16_arm
+-MC_put_o_16_arm:
++ .global _MC_put_o_16_arm
++_MC_put_o_16_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
+ pld [r1]
+ stmfd sp!, {r4-r11, lr} @ R14 is also called LR
+@@ -83,8 +83,8 @@
+
+ @ ----------------------------------------------------------------
+ .align
+- .global MC_put_o_8_arm
+-MC_put_o_8_arm:
++ .global _MC_put_o_8_arm
++_MC_put_o_8_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
+ pld [r1]
+ stmfd sp!, {r4-r10, lr} @ R14 is also called LR
+@@ -152,8 +152,8 @@
+ .endm
+
+ .align
+- .global MC_put_x_16_arm
+-MC_put_x_16_arm:
++ .global _MC_put_x_16_arm
++_MC_put_x_16_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
+ pld [r1]
+ stmfd sp!, {r4-r11,lr} @ R14 is also called LR
+@@ -244,8 +244,8 @@
+
+ @ ----------------------------------------------------------------
+ .align
+- .global MC_put_x_8_arm
+-MC_put_x_8_arm:
++ .global _MC_put_x_8_arm
++_MC_put_x_8_arm:
+ @@ void func(uint8_t * dest, const uint8_t * ref, int stride, int height)
+ pld [r1]
+ stmfd sp!, {r4-r11,lr} @ R14 is also called LR
+
diff --git a/tools/darwin/depends/libmpeg2/02-neon.patch b/tools/darwin/depends/libmpeg2/02-neon.patch
new file mode 100644
index 0000000000..329551b65e
--- /dev/null
+++ b/tools/darwin/depends/libmpeg2/02-neon.patch
@@ -0,0 +1,385 @@
+Index: include/mpeg2.h
+===================================================================
+--- include/mpeg2.h (révision 1193)
++++ include/mpeg2.h (copie de travail)
+@@ -164,6 +164,7 @@
+ #define MPEG2_ACCEL_SPARC_VIS 1
+ #define MPEG2_ACCEL_SPARC_VIS2 2
+ #define MPEG2_ACCEL_ARM 1
++#define MPEG2_ACCEL_ARM_NEON 2
+ #define MPEG2_ACCEL_DETECT 0x80000000
+
+ uint32_t mpeg2_accel (uint32_t accel);
+Index: libmpeg2/motion_comp_neon.c
+===================================================================
+--- libmpeg2/motion_comp_neon.c (révision 0)
++++ libmpeg2/motion_comp_neon.c (révision 0)
+@@ -0,0 +1,302 @@
++/*
++ * motion_comp_neon.c
++ * Copyright (C) 2009 Rémi Denis-Courmont
++ *
++ * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
++ * See http://libmpeg2.sourceforge.net/ for updates.
++ *
++ * mpeg2dec 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.
++ *
++ * mpeg2dec is distributed in the hope that 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 mpeg2dec; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++ */
++
++#include "config.h"
++
++#if defined(ARCH_ARM)
++
++#include <stdint.h>
++#include <string.h>
++
++#include "mpeg2.h"
++#include "attributes.h"
++#include "mpeg2_internal.h"
++
++/* dest = ref */
++static void MC_put_o_16_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ do {
++ memcpy (dest, ref, 16);
++ ref += stride;
++ dest += stride;
++ } while (--height);
++}
++
++static void MC_put_o_8_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ do {
++ memcpy (dest, ref, 8);
++ ref += stride;
++ dest += stride;
++ } while (--height);
++}
++
++/* dest = (src1 + src2 + 1) / 2 */
++static void MC_avg_1_16_neon (uint8_t * dest, const uint8_t * src1,
++ const uint8_t * src2,
++ const int stride, unsigned height)
++{
++ do {
++ asm volatile (
++ "vld1.u8 {q0}, [%[src1]]\n"
++ "vld1.u8 {q1}, [%[src2]]\n"
++ "vrhadd.u8 q0, q0, q1\n"
++ /* XXX: three cycles stall */
++ "vst1.u8 {q0}, [%[dest]]\n"
++ :
++ : [dest]"r"(dest), [src1]"r"(src1), [src2]"r"(src2)
++ : "memory", "q0", "q1");
++ src1 += stride;
++ src2 += stride;
++ dest += stride;
++ } while (--height);
++}
++
++static void MC_avg_1_8_neon (uint8_t * dest, const uint8_t * src1,
++ const uint8_t * src2,
++ const int stride, unsigned height)
++{
++ do {
++ asm volatile (
++ "vld1.u8 {d0}, [%[src1]]\n"
++ "vld1.u8 {d1}, [%[src2]]\n"
++ "vrhadd.u8 d0, d0, d1\n"
++ "vst1.u8 {d0}, [%[dest]]\n"
++ :
++ : [dest]"r"(dest), [src1]"r"(src1), [src2]"r"(src2)
++ : "memory", "q0");
++
++ src1 += stride;
++ src2 += stride;
++ dest += stride;
++ } while (--height);
++}
++
++/* dest = (dest + ((src1 + src2 + 1) / 2) + 1) / 2 */
++static void MC_avg_2_16_neon (uint8_t * dest, const uint8_t * src1,
++ const uint8_t * src2,
++ const int stride, unsigned height)
++{
++ do {
++ asm volatile (
++ "vld1.u8 {q0}, [%[src1]]\n"
++ "vld1.u8 {q1}, [%[src2]]\n"
++ "vrhadd.u8 q0, q0, q1\n"
++ "vld1.u8 {q2}, [%[dest]]\n"
++ /* XXX: one cycle stall */
++ "vrhadd.u8 q0, q0, q2\n"
++ /* XXX: three cycles stall */
++ "vst1.u8 {q0}, [%[dest]]\n"
++ :
++ : [dest]"r"(dest), [src1]"r"(src1), [src2]"r"(src2)
++ : "memory", "q0", "q1", "q2");
++ src1 += stride;
++ src2 += stride;
++ dest += stride;
++ } while (--height);
++}
++
++static void MC_avg_2_8_neon (uint8_t * dest, const uint8_t * src1,
++ const uint8_t * src2,
++ const int stride, unsigned height)
++{
++ do {
++ asm volatile (
++ "vld1.u8 {d0}, [%[src1]]\n"
++ "vld1.u8 {d1}, [%[src2]]\n"
++ "vrhadd.u8 d0, d0, d1\n"
++ "vld1.u8 {d2}, [%[dest]]\n"
++ "vrhadd.u8 d0, d0, d2\n"
++ "vst1.u8 {d0}, [%[dest]]\n"
++ :
++ : [dest]"r"(dest), [src1]"r"(src1), [src2]"r"(src2)
++ : "memory", "q0", "d2");
++ src1 += stride;
++ src2 += stride;
++ dest += stride;
++ } while (--height);
++}
++
++static void MC_avg_o_16_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ MC_avg_1_16_neon (dest, dest, ref, stride, height);
++}
++
++static void MC_avg_o_8_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ MC_avg_1_8_neon (dest, dest, ref, stride, height);
++}
++
++static void MC_put_x_16_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ MC_avg_1_16_neon (dest, ref, ref + 1, stride, height);
++}
++
++static void MC_put_x_8_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ MC_avg_1_8_neon (dest, ref, ref + 1, stride, height);
++}
++
++static void MC_avg_x_16_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ MC_avg_2_16_neon (dest, ref, ref + 1, stride, height);
++}
++
++static void MC_avg_x_8_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ MC_avg_2_8_neon (dest, ref, ref + 1, stride, height);
++}
++
++static void MC_put_y_16_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ MC_avg_1_16_neon (dest, ref, ref + stride, stride, height);
++}
++static void MC_put_y_8_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ MC_avg_1_8_neon (dest, ref, ref + stride, stride, height);
++}
++
++static void MC_avg_y_16_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ MC_avg_2_16_neon (dest, ref, ref + stride, stride, height);
++}
++
++static void MC_avg_y_8_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ MC_avg_2_8_neon (dest, ref, ref + stride, stride, height);
++}
++
++static void MC_put_xy_16_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ do {
++ asm volatile (
++ "vld1.u8 {q0}, [%[ref]]\n"
++ "vld1.u8 {q1}, [%[refx]]\n"
++ "vrhadd.u8 q0, q0, q1\n"
++ "vld1.u8 {q2}, [%[refy]]\n"
++ "vld1.u8 {q3}, [%[refxy]]\n"
++ "vrhadd.u8 q2, q2, q3\n"
++ /* XXX: three cycles stall */
++ "vrhadd.u8 q0, q0, q2\n"
++ /* XXX: three cycles stall */
++ "vst1.u8 {q0}, [%[dest]]\n"
++ :
++ : [dest]"r"(dest), [ref]"r"(ref), [refx]"r"(ref + 1),
++ [refy]"r"(ref + stride), [refxy]"r"(ref + stride + 1)
++ : "memory", "q0", "q1", "q2", "q3");
++ ref += stride;
++ dest += stride;
++ } while (--height);
++}
++
++static void MC_put_xy_8_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ do {
++ asm volatile (
++ "vld1.u8 {d0}, [%[ref]]\n"
++ "vld1.u8 {d1}, [%[refx]]\n"
++ "vrhadd.u8 d0, d0, d1\n"
++ "vld1.u8 {d2}, [%[refy]]\n"
++ "vld1.u8 {d3}, [%[refxy]]\n"
++ "vrhadd.u8 d2, d2, d3\n"
++ /* XXX: three cycles stall */
++ "vrhadd.u8 d0, d0, d2\n"
++ /* XXX: three cycles stall */
++ "vst1.u8 {d0}, [%[dest]]\n"
++ :
++ : [dest]"r"(dest), [ref]"r"(ref), [refx]"r"(ref + 1),
++ [refy]"r"(ref + stride), [refxy]"r"(ref + stride + 1)
++ : "memory", "q0", "q1");
++ ref += stride;
++ dest += stride;
++ } while (--height);
++}
++
++static void MC_avg_xy_16_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ do {
++ asm volatile (
++ "vld1.u8 {q0}, [%[ref]]\n"
++ "vld1.u8 {q1}, [%[refx]]\n"
++ "vrhadd.u8 q0, q0, q1\n"
++ "vld1.u8 {q2}, [%[refy]]\n"
++ "vld1.u8 {q3}, [%[refxy]]\n"
++ "vrhadd.u8 q2, q2, q3\n"
++ "vld1.u8 {q4}, [%[dest]]\n"
++ /* XXX: one cycle stall */
++ "vrhadd.u8 q0, q0, q2\n"
++ /* XXX: three cycles stall */
++ "vrhadd.u8 q0, q4, q0\n"
++ "vst1.u8 {q0}, [%[dest]]\n"
++ :
++ : [dest]"r"(dest), [ref]"r"(ref), [refx]"r"(ref + 1),
++ [refy]"r"(ref + stride), [refxy]"r"(ref + stride + 1)
++ : "memory", "q0", "q1", "q2", "q3", "q4");
++ ref += stride;
++ dest += stride;
++ } while (--height);
++}
++
++static void MC_avg_xy_8_neon (uint8_t * dest, const uint8_t * ref,
++ const int stride, int height)
++{
++ do {
++ asm volatile (
++ "vld1.u8 {d0}, [%[ref]]\n"
++ "vld1.u8 {d1}, [%[refx]]\n"
++ "vrhadd.u8 d0, d0, d1\n"
++ "vld1.u8 {d2}, [%[refy]]\n"
++ "vld1.u8 {d3}, [%[refxy]]\n"
++ "vrhadd.u8 d2, d2, d3\n"
++ "vld1.u8 {d4}, [%[dest]]\n"
++ /* XXX: one cycle stall */
++ "vrhadd.u8 d0, d0, d2\n"
++ /* XXX: three cycles stall */
++ "vrhadd.u8 d0, d4, d0\n"
++ "vst1.u8 {d0}, [%[dest]]\n"
++ :
++ : [dest]"r"(dest), [ref]"r"(ref), [refx]"r"(ref + 1),
++ [refy]"r"(ref + stride), [refxy]"r"(ref + stride + 1)
++ : "memory", "q0", "q1", "d4");
++ ref += stride;
++ dest += stride;
++ } while (--height);
++}
++
++MPEG2_MC_EXTERN (neon)
++
++#endif /* ARCH_ARM */
+
+Modification de propriétés sur libmpeg2/motion_comp_neon.c
+___________________________________________________________________
+Ajouté : svn:eol-style
+ + native
+
+Index: libmpeg2/mpeg2_internal.h
+===================================================================
+--- libmpeg2/mpeg2_internal.h (révision 1193)
++++ libmpeg2/mpeg2_internal.h (copie de travail)
+@@ -313,5 +313,6 @@
+ extern mpeg2_mc_t mpeg2_mc_alpha;
+ extern mpeg2_mc_t mpeg2_mc_vis;
+ extern mpeg2_mc_t mpeg2_mc_arm;
++extern mpeg2_mc_t mpeg2_mc_neon;
+
+ #endif /* LIBMPEG2_MPEG2_INTERNAL_H */
+Index: libmpeg2/motion_comp.c
+===================================================================
+--- libmpeg2/motion_comp.c (révision 1193)
++++ libmpeg2/motion_comp.c (copie de travail)
+@@ -58,6 +58,11 @@
+ else
+ #endif
+ #ifdef ARCH_ARM
++#ifdef ARCH_ARM
++ if (accel & MPEG2_ACCEL_ARM)
++ mpeg2_mc = mpeg2_mc_neon;
++ else
++#endif
+ if (accel & MPEG2_ACCEL_ARM) {
+ mpeg2_mc = mpeg2_mc_arm;
+ } else
+Index: libmpeg2/Makefile.am
+===================================================================
+--- libmpeg2/Makefile.am (révision 1193)
++++ libmpeg2/Makefile.am (copie de travail)
+@@ -14,7 +14,7 @@
+ motion_comp_vis.c motion_comp_arm.c \
+ cpu_accel.c cpu_state.c
+ if ARCH_ARM
+-libmpeg2arch_la_SOURCES += motion_comp_arm_s.S
++libmpeg2arch_la_SOURCES += motion_comp_arm_s.S motion_comp_neon.c
+ endif
+ libmpeg2arch_la_CFLAGS = $(OPT_CFLAGS) $(ARCH_OPT_CFLAGS) $(LIBMPEG2_CFLAGS)
+
+Index: configure.ac
+===================================================================
+--- configure.ac (révision 1193)
++++ configure.ac (copie de travail)
+@@ -103,7 +103,14 @@
+ AC_DEFINE([ARCH_ALPHA],,[alpha architecture]);;
+ arm*)
+ arm_conditional=:
+- AC_DEFINE([ARCH_ARM],,[ARM architecture]);;
++ AC_DEFINE([ARCH_ARM],,[ARM architecture])
++ AC_MSG_CHECKING([if inline ARM Advanced SIMD assembly is supported])
++ AC_TRY_COMPILE([],
++ [asm ("vqmovun.s64 d0, q1":::"d0");],
++ [AC_DEFINE([ARCH_ARM_NEON],, [ARM Advanced SIMD assembly])
++ AC_MSG_RESULT(yes)],
++ [AC_MSG_RESULT(no)])
++ ;;
+ esac
+ elif test x"$CC" = x"tendracc"; then
+ dnl TenDRA portability checking compiler
diff --git a/tools/darwin/depends/libmpeg2/03-config-fix.patch b/tools/darwin/depends/libmpeg2/03-config-fix.patch
new file mode 100644
index 0000000000..98f766ed6a
--- /dev/null
+++ b/tools/darwin/depends/libmpeg2/03-config-fix.patch
@@ -0,0 +1,208 @@
+--- a/libmpeg2/Makefile.in 2011-01-29 10:17:27.000000000 +0100
++++ b/libmpeg2/Makefile.in 2011-01-29 10:28:26.000000000 +0100
+@@ -1,8 +1,8 @@
+-# Makefile.in generated by automake 1.10.1 from Makefile.am.
++# Makefile.in generated by automake 1.10 from Makefile.am.
+ # @configure_input@
+
+ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+-# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
++# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+ # This Makefile.in is free software; the Free Software Foundation
+ # gives unlimited permission to copy and/or distribute it,
+ # with or without modifications, as long as this notice is preserved.
+@@ -33,14 +33,17 @@
+ POST_UNINSTALL = :
+ build_triplet = @build@
+ host_triplet = @host@
+-@ARCH_ARM_TRUE@am__append_1 = motion_comp_arm_s.S
++@ARCH_ARM_TRUE@am__append_1 = motion_comp_arm_s.S motion_comp_neon.c
+ subdir = libmpeg2
+ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/libmpeg2.pc.in
+ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+ am__aclocal_m4_deps = $(top_srcdir)/m4/cflags.m4 \
+ $(top_srcdir)/m4/inttypes.m4 $(top_srcdir)/m4/keywords.m4 \
+- $(top_srcdir)/m4/nonpic.m4 $(top_srcdir)/configure.ac
++ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
++ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
++ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nonpic.m4 \
++ $(top_srcdir)/configure.ac
+ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+ mkinstalldirs = $(install_sh) -d
+@@ -66,8 +69,9 @@
+ am__libmpeg2arch_la_SOURCES_DIST = motion_comp_mmx.c idct_mmx.c \
+ motion_comp_altivec.c idct_altivec.c motion_comp_alpha.c \
+ idct_alpha.c motion_comp_vis.c motion_comp_arm.c cpu_accel.c \
+- cpu_state.c motion_comp_arm_s.S
+-@ARCH_ARM_TRUE@am__objects_1 = motion_comp_arm_s.lo
++ cpu_state.c motion_comp_arm_s.S motion_comp_neon.c
++@ARCH_ARM_TRUE@am__objects_1 = motion_comp_arm_s.lo \
++@ARCH_ARM_TRUE@ libmpeg2arch_la-motion_comp_neon.lo
+ am_libmpeg2arch_la_OBJECTS = libmpeg2arch_la-motion_comp_mmx.lo \
+ libmpeg2arch_la-idct_mmx.lo \
+ libmpeg2arch_la-motion_comp_altivec.lo \
+@@ -82,7 +86,7 @@
+ libmpeg2arch_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libmpeg2arch_la_CFLAGS) \
+ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+-DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include
++DEFAULT_INCLUDES = -I. -I$(top_builddir)/include@am__isrc@
+ depcomp = $(SHELL) $(top_srcdir)/.auto/depcomp
+ am__depfiles_maybe = depfiles
+ CPPASCOMPILE = $(CCAS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+@@ -135,29 +139,25 @@
+ CFLAGS = @CFLAGS@
+ CPP = @CPP@
+ CPPFLAGS = @CPPFLAGS@
+-CXX = @CXX@
+-CXXCPP = @CXXCPP@
+-CXXDEPMODE = @CXXDEPMODE@
+-CXXFLAGS = @CXXFLAGS@
+ CYGPATH_W = @CYGPATH_W@
+ DEFS = @DEFS@
+ DEPDIR = @DEPDIR@
+ DLLTOOL = @DLLTOOL@
+ DSYMUTIL = @DSYMUTIL@
+-ECHO = @ECHO@
++DUMPBIN = @DUMPBIN@
+ ECHO_C = @ECHO_C@
+ ECHO_N = @ECHO_N@
+ ECHO_T = @ECHO_T@
+ EGREP = @EGREP@
+ EXEEXT = @EXEEXT@
+-F77 = @F77@
+-FFLAGS = @FFLAGS@
++FGREP = @FGREP@
+ GREP = @GREP@
+ INSTALL = @INSTALL@
+ INSTALL_DATA = @INSTALL_DATA@
+ INSTALL_PROGRAM = @INSTALL_PROGRAM@
+ INSTALL_SCRIPT = @INSTALL_SCRIPT@
+ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
++LD = @LD@
+ LDFLAGS = @LDFLAGS@
+ LIBMPEG2_CFLAGS = @LIBMPEG2_CFLAGS@
+ LIBOBJS = @LIBOBJS@
+@@ -165,16 +165,20 @@
+ LIBTOOL = @LIBTOOL@
+ LIBVO_CFLAGS = @LIBVO_CFLAGS@
+ LIBVO_LIBS = @LIBVO_LIBS@
++LIPO = @LIPO@
+ LN_S = @LN_S@
+ LTLIBOBJS = @LTLIBOBJS@
+ MAINT = @MAINT@
+ MAKEINFO = @MAKEINFO@
+ MKDIR_P = @MKDIR_P@
+ MPEG2DEC_CFLAGS = @MPEG2DEC_CFLAGS@
++NM = @NM@
+ NMEDIT = @NMEDIT@
+ OBJDUMP = @OBJDUMP@
+ OBJEXT = @OBJEXT@
+ OPT_CFLAGS = @OPT_CFLAGS@
++OTOOL = @OTOOL@
++OTOOL64 = @OTOOL64@
+ PACKAGE = @PACKAGE@
+ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+ PACKAGE_NAME = @PACKAGE_NAME@
+@@ -199,8 +203,7 @@
+ abs_top_builddir = @abs_top_builddir@
+ abs_top_srcdir = @abs_top_srcdir@
+ ac_ct_CC = @ac_ct_CC@
+-ac_ct_CXX = @ac_ct_CXX@
+-ac_ct_F77 = @ac_ct_F77@
++ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ am__include = @am__include@
+ am__leading_dot = @am__leading_dot@
+ am__quote = @am__quote@
+@@ -231,6 +234,7 @@
+ libexecdir = @libexecdir@
+ localedir = @localedir@
+ localstatedir = @localstatedir@
++lt_ECHO = @lt_ECHO@
+ mandir = @mandir@
+ mkdir_p = @mkdir_p@
+ oldincludedir = @oldincludedir@
+@@ -301,8 +305,8 @@
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ if test -f $$p; then \
+ f=$(am__strip_dir) \
+- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
+- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
++ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \
++ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \
+ else :; fi; \
+ done
+
+@@ -310,8 +314,8 @@
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ p=$(am__strip_dir) \
+- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
+- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
++ echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \
++ $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \
+ done
+
+ clean-libLTLIBRARIES:
+@@ -355,6 +359,7 @@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpeg2arch_la-motion_comp_altivec.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpeg2arch_la-motion_comp_arm.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpeg2arch_la-motion_comp_mmx.Plo@am__quote@
++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpeg2arch_la-motion_comp_neon.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpeg2arch_la-motion_comp_vis.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motion_comp.Plo@am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/motion_comp_arm_s.Plo@am__quote@
+@@ -472,6 +477,13 @@
+ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmpeg2arch_la_CFLAGS) $(CFLAGS) -c -o libmpeg2arch_la-cpu_state.lo `test -f 'cpu_state.c' || echo '$(srcdir)/'`cpu_state.c
+
++libmpeg2arch_la-motion_comp_neon.lo: motion_comp_neon.c
++@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmpeg2arch_la_CFLAGS) $(CFLAGS) -MT libmpeg2arch_la-motion_comp_neon.lo -MD -MP -MF $(DEPDIR)/libmpeg2arch_la-motion_comp_neon.Tpo -c -o libmpeg2arch_la-motion_comp_neon.lo `test -f 'motion_comp_neon.c' || echo '$(srcdir)/'`motion_comp_neon.c
++@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libmpeg2arch_la-motion_comp_neon.Tpo $(DEPDIR)/libmpeg2arch_la-motion_comp_neon.Plo
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='motion_comp_neon.c' object='libmpeg2arch_la-motion_comp_neon.lo' libtool=yes @AMDEPBACKSLASH@
++@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
++@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmpeg2arch_la_CFLAGS) $(CFLAGS) -c -o libmpeg2arch_la-motion_comp_neon.lo `test -f 'motion_comp_neon.c' || echo '$(srcdir)/'`motion_comp_neon.c
++
+ mostlyclean-libtool:
+ -rm -f *.lo
+
+@@ -570,8 +582,8 @@
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+- $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+- END { if (nonempty) { for (i in files) print i; }; }'`; \
++ $(AWK) ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+ tags: TAGS
+
+@@ -596,8 +608,8 @@
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+- END { if (nonempty) { for (i in files) print i; }; }'`; \
++ $(AWK) ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+@@ -607,12 +619,13 @@
+ CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
++ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+- END { if (nonempty) { for (i in files) print i; }; }'`; \
++ $(AWK) ' { files[$$0] = 1; } \
++ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
diff --git a/tools/darwin/depends/libmpeg2/Makefile b/tools/darwin/depends/libmpeg2/Makefile
new file mode 100644
index 0000000000..2daebca231
--- /dev/null
+++ b/tools/darwin/depends/libmpeg2/Makefile
@@ -0,0 +1,40 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=libmpeg2
+VERSION=0.5.1
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --disable-sdl
+
+LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); patch -p1 < ../01-libmpeg2-add-asm-leading-underscores.patch
+ cd $(SOURCE); patch -p1 < ../03-config-fix.patch
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libogg/Makefile b/tools/darwin/depends/libogg/Makefile
new file mode 100644
index 0000000000..74a0bbf70a
--- /dev/null
+++ b/tools/darwin/depends/libogg/Makefile
@@ -0,0 +1,37 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=libogg
+VERSION=1.1.4
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX)
+
+LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libpng/Makefile b/tools/darwin/depends/libpng/Makefile
new file mode 100644
index 0000000000..1dddac47f0
--- /dev/null
+++ b/tools/darwin/depends/libpng/Makefile
@@ -0,0 +1,37 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=libpng
+VERSION=1.2.38
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX)
+
+LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/librtmp/01-make_shared_lib_for_darwin-tag2.3.patch b/tools/darwin/depends/librtmp/01-make_shared_lib_for_darwin-tag2.3.patch
new file mode 100644
index 0000000000..358a0ff6f7
--- /dev/null
+++ b/tools/darwin/depends/librtmp/01-make_shared_lib_for_darwin-tag2.3.patch
@@ -0,0 +1,85 @@
+diff -uNr rtmpdump-2.3/Makefile rtmpdump-2.3-org/Makefile
+--- rtmpdump-2.3/Makefile 2010-06-30 15:58:35.000000000 -0400
++++ rtmpdump-2.3-org/Makefile 2011-01-23 13:50:03.000000000 -0500
+@@ -2,8 +2,8 @@
+
+ prefix=/usr/local
+
+-CC=$(CROSS_COMPILE)gcc
+-LD=$(CROSS_COMPILE)ld
++#CC=$(CROSS_COMPILE)gcc
++#LD=$(CROSS_COMPILE)ld
+
+ SYS=posix
+ #SYS=mingw
+@@ -33,10 +33,12 @@
+
+ LIBS_posix=
+ LIBS_mingw=-lws2_32 -lwinmm -lgdi32
++LIBS_darwin=
+ LIBS=$(CRYPTO_LIB) -lz $(LIBS_$(SYS)) $(XLIBS)
+
+ THREADLIB_posix=-lpthread
+ THREADLIB_mingw=
++THREADLIB_darwin=-lpthread
+ THREADLIB=$(THREADLIB_$(SYS))
+ SLIBS=$(THREADLIB) $(LIBS)
+
+@@ -45,6 +47,7 @@
+
+ EXT_posix=
+ EXT_mingw=.exe
++EXT_darwin=
+ EXT=$(EXT_$(SYS))
+
+ all: $(LIBRTMP) progs
+diff -uNr rtmpdump-2.3/librtmp/Makefile rtmpdump-2.3-org/librtmp/Makefile
+--- rtmpdump-2.3/librtmp/Makefile 2010-06-30 16:01:28.000000000 -0400
++++ rtmpdump-2.3-org/librtmp/Makefile 2011-01-23 13:56:46.000000000 -0500
+@@ -2,9 +2,9 @@
+
+ prefix=/usr/local
+
+-CC=$(CROSS_COMPILE)gcc
+-LD=$(CROSS_COMPILE)ld
+-AR=$(CROSS_COMPILE)ar
++#CC=$(CROSS_COMPILE)gcc
++#LD=$(CROSS_COMPILE)ld
++#AR=$(CROSS_COMPILE)ar
+
+ SYS=posix
+ CRYPTO=OPENSSL
+@@ -27,8 +27,14 @@
+
+ SO_posix=so.0
+ SO_mingw=dll
++SO_darwin=0.dylib
+ SO_EXT=$(SO_$(SYS))
+
++SO_LDFLAGS_posix=-shared -Wl,-soname,$@
++SO_LDFLAGS_mingw=
++SO_LDFLAGS_darwin=-dynamiclib -twolevel_namespace $(XLDFLAGS)
++SO_LDFLAGS=$(SO_LDFLAGS_$(SYS))
++
+ SHARED=yes
+ SODEF_yes=-fPIC
+ SOLIB_yes=librtmp.$(SO_EXT)
+@@ -61,7 +67,7 @@
+ $(AR) rs $@ $?
+
+ librtmp.$(SO_EXT): $(OBJS)
+- $(CC) -shared -Wl,-soname,$@ $(LDFLAGS) -o $@ $^ $> $(CRYPTO_LIB)
++ $(CC) $(SO_LDFLAGS) $(LDFLAGS) -o $@ $^ $> $(CRYPTO_LIB)
+ ln -sf $@ librtmp.so
+
+ log.o: log.c log.h Makefile
+@@ -87,5 +93,9 @@
+ cp librtmp.so.0 $(LIBDIR)
+ cd $(LIBDIR); ln -sf librtmp.so.0 librtmp.so
+
++install_0.dylib: librtmp.0.dylib
++ cp librtmp.0.dylib $(LIBDIR)
++ cd $(LIBDIR); ln -sf librtmp.0.dylib librtmp.dylib
++
+ install_dll: librtmp.dll
+ cp librtmp.dll $(BINDIR)
diff --git a/tools/darwin/depends/librtmp/Makefile b/tools/darwin/depends/librtmp/Makefile
new file mode 100644
index 0000000000..a7ab557ebe
--- /dev/null
+++ b/tools/darwin/depends/librtmp/Makefile
@@ -0,0 +1,37 @@
+include ../Makefile.include
+include ../config.site.mk
+
+# lib name, version
+LIBNAME=rtmpdump
+VERSION=2.3
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tgz
+
+# configuration settings
+
+LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); patch -p1 < ../01-make_shared_lib_for_darwin-tag2.3.patch
+
+$(LIBDYLIB): $(SOURCE)
+ make SYS=darwin prefix=$(PREFIX) XCFLAGS="$(CFLAGS)" XLDFLAGS="$(LDFLAGS)" -C $(SOURCE)/librtmp
+
+.installed:
+ make SYS=darwin prefix=$(PREFIX) -C $(SOURCE)/librtmp install
+ touch $@
+
+clean:
+ make SYS=darwin -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libsamplerate/01-libsamplerate-arm.patch b/tools/darwin/depends/libsamplerate/01-libsamplerate-arm.patch
new file mode 100644
index 0000000000..b14b0dac57
--- /dev/null
+++ b/tools/darwin/depends/libsamplerate/01-libsamplerate-arm.patch
@@ -0,0 +1,13 @@
+diff -ruN libsamplerate-0.1.7/src/float_cast.h.org src/float_cast.h
+--- libsamplerate-0.1.7/src/float_cast.h.org 2010-10-28 21:00:19.000000000 -0400
++++ libsamplerate-0.1.7/src/float_cast.h 2010-10-28 21:00:52.000000000 -0400
+@@ -193,7 +193,7 @@
+ return res [1] ;
+ } /* double2int */
+
+-#elif (defined (__MACH__) && defined (__APPLE__))
++#elif (defined (__MACH__) && defined (__APPLE__) && !defined(__arm__))
+
+ /* For Apple MacOSX. */
+
+
diff --git a/tools/darwin/depends/libsamplerate/Makefile b/tools/darwin/depends/libsamplerate/Makefile
new file mode 100644
index 0000000000..dcc610c55a
--- /dev/null
+++ b/tools/darwin/depends/libsamplerate/Makefile
@@ -0,0 +1,39 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=libsamplerate
+VERSION=0.1.7
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --disable-sndfile --disable-fftw
+
+LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); patch -p1 < ../01-libsamplerate-arm.patch
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libsdl/01-SDL_SetWidthHeight.patch b/tools/darwin/depends/libsdl/01-SDL_SetWidthHeight.patch
new file mode 100644
index 0000000000..6213a01e4e
--- /dev/null
+++ b/tools/darwin/depends/libsdl/01-SDL_SetWidthHeight.patch
@@ -0,0 +1,32 @@
+Index: include/SDL_video.h
+===================================================================
+--- include/SDL_video.h (revision 4116)
++++ include/SDL_video.h (working copy)
+@@ -287,6 +287,11 @@
+ extern DECLSPEC SDL_Rect ** SDLCALL SDL_ListModes(SDL_PixelFormat *format, Uint32 flags);
+
+ /*
++ * Alter the width and height of the current surface to the given sizes.
++ */
++extern DECLSPEC void SDLCALL SDL_SetWidthHeight(int width, int height);
++
++/*
+ * Set up a video mode with the specified width, height and bits-per-pixel.
+ *
+ * If 'bpp' is 0, it is treated as the current display bits per pixel.
+Index: src/video/SDL_video.c
+===================================================================
+--- src/video/SDL_video.c (revision 4116)
++++ src/video/SDL_video.c (working copy)
+@@ -1949,3 +1949,11 @@
+ return(0);
+ }
+ }
++
++void SDL_SetWidthHeight(int width, int height)
++{
++ if (current_video != NULL && current_video->screen != NULL) {
++ current_video->screen->w = width;
++ current_video->screen->h = height;
++ }
++}
diff --git a/tools/darwin/depends/libsdl/Makefile b/tools/darwin/depends/libsdl/Makefile
new file mode 100644
index 0000000000..b88f838dd1
--- /dev/null
+++ b/tools/darwin/depends/libsdl/Makefile
@@ -0,0 +1,40 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=SDL
+VERSION=1.2.13
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --without-x --disable-video-x11
+
+LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+ echo $(ARCHIVE) > .gitignore
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); patch -p0 < ../01-SDL_SetWidthHeight.patch
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libsdl_image/Makefile b/tools/darwin/depends/libsdl_image/Makefile
new file mode 100644
index 0000000000..051f3c8ebf
--- /dev/null
+++ b/tools/darwin/depends/libsdl_image/Makefile
@@ -0,0 +1,38 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=SDL_image
+VERSION=1.2.7
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --disable-jpg-shared --disable-png-shared --disable-tif-shared --disable-sdltest
+
+LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).a
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libsdl_mixer/Makefile b/tools/darwin/depends/libsdl_mixer/Makefile
new file mode 100644
index 0000000000..aee1b0432f
--- /dev/null
+++ b/tools/darwin/depends/libsdl_mixer/Makefile
@@ -0,0 +1,40 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=SDL_mixer
+VERSION=1.2.8
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --disable-music-ogg --disable-music-mp3 \
+ --disable-music-mod --disable-music-midi --disable-smpegtest --disable-sdltest
+
+LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).a
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ sed -ie "s|@SDL_LIBS@|@SDL_LIBS@ -arch $(ARCH) -mmacosx-version-min=$(SDK)|" "$(SOURCE)/Makefile.in"
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install-hdrs install-lib
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libssh2/Makefile b/tools/darwin/depends/libssh2/Makefile
new file mode 100644
index 0000000000..925c74443c
--- /dev/null
+++ b/tools/darwin/depends/libssh2/Makefile
@@ -0,0 +1,42 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=libssh2
+VERSION=1.2.7
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --with-openssl --without-libgcrypt
+
+SHELL := /bin/bash
+RM := rm -rf
+
+LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
+
diff --git a/tools/darwin/depends/libtool/Makefile b/tools/darwin/depends/libtool/Makefile
new file mode 100644
index 0000000000..b0713f74c9
--- /dev/null
+++ b/tools/darwin/depends/libtool/Makefile
@@ -0,0 +1,39 @@
+include ../Makefile.include
+
+# lib name, version
+APPNAME=libtool
+VERSION=2.2.6
+SOURCE=$(APPNAME)-$(VERSION)
+ARCHIVE=$(SOURCE)a.tar.gz
+
+# configuration settings
+export PATH:=$(TOOLCHAIN)/bin:$(PATH)
+CONFIGURE=./configure --prefix=$(TOOLCHAIN) \
+ --program-prefix=g
+
+APP=$(SOURCE)/bin/$(APPNAME)
+
+all: $(APP) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(APP): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libvorbis/Makefile b/tools/darwin/depends/libvorbis/Makefile
new file mode 100644
index 0000000000..123639e23b
--- /dev/null
+++ b/tools/darwin/depends/libvorbis/Makefile
@@ -0,0 +1,40 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=libvorbis
+VERSION=1.2.3
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --disable-oggtest --disable-docs --disable-examples
+
+LIBDYLIB=$(SOURCE)/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ sed -ie "s|DDARWIN -fno-common -force_cpusubtype_ALL|DARWIN_NO_CARBON -fno-common -noforce_cpusubtype_ALL|" "$(SOURCE)/configure"
+ sed -ie "s|SUBDIRS = m4 include vq lib examples test doc|SUBDIRS = m4 include lib|" "$(SOURCE)/Makefile.in"
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/libwavpack/Makefile b/tools/darwin/depends/libwavpack/Makefile
new file mode 100644
index 0000000000..cc8934aa71
--- /dev/null
+++ b/tools/darwin/depends/libwavpack/Makefile
@@ -0,0 +1,37 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=wavpack
+VERSION=4.60.1
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.bz2
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX)
+
+LIBDYLIB=$(SOURCE)/.libs/lib$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/mysqlclient/Makefile b/tools/darwin/depends/mysqlclient/Makefile
new file mode 100644
index 0000000000..2fd279133b
--- /dev/null
+++ b/tools/darwin/depends/mysqlclient/Makefile
@@ -0,0 +1,40 @@
+include ../Makefile.include
+
+LIBNAME=mysql
+VERSION=5.1.55
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --enable-thread-safe-client -with-extra-charsets=complex \
+ --without-readline --without-server --without-bench --without-docs --without-man
+
+LIBDYLIB=$(SOURCE)/libmysql/.libs/$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE)/scripts install
+ make -C $(SOURCE)/include install
+ make -C $(SOURCE)/libmysql install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/openssl/Makefile b/tools/darwin/depends/openssl/Makefile
new file mode 100644
index 0000000000..1bb9b76ed8
--- /dev/null
+++ b/tools/darwin/depends/openssl/Makefile
@@ -0,0 +1,38 @@
+include ../Makefile.include
+include ../config.site.mk
+
+# lib name, version
+LIBNAME=openssl
+VERSION=1.0.0a
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./Configure darwin-$(ARCH)-cc zlib no-asm no-krb5 shared --openssldir=$(PREFIX)
+
+LIBDYLIB=$(SOURCE)/src/.libs/lib$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ -rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install_sw
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/pcre/Makefile b/tools/darwin/depends/pcre/Makefile
new file mode 100644
index 0000000000..a8a771807a
--- /dev/null
+++ b/tools/darwin/depends/pcre/Makefile
@@ -0,0 +1,38 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=pcre
+VERSION=7.9
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --disable-stack-for-recursion
+
+LIBDYLIB=$(SOURCE)/.libs/(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/pkg-config/Makefile b/tools/darwin/depends/pkg-config/Makefile
new file mode 100644
index 0000000000..f79724bd10
--- /dev/null
+++ b/tools/darwin/depends/pkg-config/Makefile
@@ -0,0 +1,38 @@
+include ../Makefile.include
+
+# lib name, version
+APPNAME=pkg-config
+VERSION=0.23
+SOURCE=$(APPNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+export PATH:=$(TOOLCHAIN)/bin:$(PATH)
+CONFIGURE=./configure --prefix=$(TOOLCHAIN) --enable-indirect-deps --with-pc-path=$(PREFIX)/lib/pkgconfig:$(PREFIX)/share/pkgconfig
+
+APP=$(SOURCE)/bin/pkg-config
+
+all: $(APP) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(APP): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/python26/Makefile b/tools/darwin/depends/python26/Makefile
new file mode 100644
index 0000000000..217e36ad4b
--- /dev/null
+++ b/tools/darwin/depends/python26/Makefile
@@ -0,0 +1,43 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=Python
+VERSION=2.6.5
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.bz2
+
+# configuration settings
+export OPT=$(CFLAGS)
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --enable-shared --disable-toolbox-glue --enable-unicode=ucs4
+
+LIBDYLIB=$(SOURCE)/libpython2.6.dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(LIBDYLIB): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+ # python2.6 has an issue detecting and using the same version of openssl in configure and setup.py
+ # this forces python2.6 hashlib to be compatible with osx 10.4 boxes.
+ sed -ie "s|openssl_ver >= 0x00907000)|openssl_ver >= 0x00907000 and False)|" "$(SOURCE)/setup.py"
+ sed -ie "s|(openssl_ver < 0x00908000)|(True or openssl_ver < 0x00908000)|" "$(SOURCE)/setup.py"
+ cd $(SOURCE); make
+
+.installed:
+ cd $(SOURCE); make install
+ find $(PREFIX)/lib/python2.6 -type f -name *.pyc -exec rm -f {} \;
+ find $(PREFIX)/lib/python2.6 -type f -name *.pyo -exec rm -f {} \;
+ touch $@
+
+clean:
+ rm -rf $(SOURCE) .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
+
diff --git a/tools/darwin/depends/readline/Makefile b/tools/darwin/depends/readline/Makefile
new file mode 100644
index 0000000000..3e537a4cad
--- /dev/null
+++ b/tools/darwin/depends/readline/Makefile
@@ -0,0 +1,38 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=readline
+VERSION=6.0
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX)
+
+LIBDYLIB=$(SOURCE)/shlib/(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); autoconf
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/samba/Makefile b/tools/darwin/depends/samba/Makefile
new file mode 100644
index 0000000000..c1dfee0d40
--- /dev/null
+++ b/tools/darwin/depends/samba/Makefile
@@ -0,0 +1,50 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=samba
+VERSION=3.5.6
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --without-cluster-support --disable-swat --without-ldap \
+ --without-pam --without-pam_smbpass --with-fhs
+
+LIBDYLIB=$(SOURCE)/source3/bin/libsmbclient.dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(LIBDYLIB): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE)/source3; ./autogen.sh
+ cd $(SOURCE)/source3; $(CONFIGURE)
+ #cp -f /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$(platform_sdk_version).sdk/usr/include/crt_externs.h $(PREFIX)/include/
+ cd $(SOURCE)/source3; make bin/libsmbclient.dylib
+
+.installed:
+ cp -f $(SOURCE)/source3/include/libsmbclient.h $(PREFIX)/include/
+ cp -f $(SOURCE)/source3/bin/libtdb.dylib.1 $(PREFIX)/lib/
+ cp -f $(SOURCE)/source3/bin/libtalloc.dylib.2 $(PREFIX)/lib/
+ cp -f $(SOURCE)/source3/bin/libsmbclient.dylib.0 $(PREFIX)/lib/
+ cd $(PREFIX)/lib; ln -sf libsmbclient.dylib.0 libsmbclient.dylib
+ install_name_tool -id $(PREFIX)/lib/libtdb.dylib.1 $(PREFIX)/lib/libtdb.dylib.1
+ install_name_tool -id $(PREFIX)/lib/libtalloc.dylib.2 $(PREFIX)/lib/libtalloc.dylib.2
+ install_name_tool -id $(PREFIX)/lib/libsmbclient.dylib.0 $(PREFIX)/lib/libsmbclient.dylib.0
+ install_name_tool -change bin/libtdb.dylib.1 $(PREFIX)/lib/libtdb.dylib.1 \
+ $(PREFIX)/lib/libsmbclient.dylib.0
+ install_name_tool -change bin/libtalloc.dylib.2 $(PREFIX)/lib/libtalloc.dylib.2 \
+ $(PREFIX)/lib/libsmbclient.dylib.0
+ touch $@
+
+clean:
+ make -C $(SOURCE)/source3 clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/sqlite3/Makefile b/tools/darwin/depends/sqlite3/Makefile
new file mode 100644
index 0000000000..78a7c7c54b
--- /dev/null
+++ b/tools/darwin/depends/sqlite3/Makefile
@@ -0,0 +1,42 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=sqlite
+VERSION=3.6.11
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+export CXXFLAGS+=-DSQLITE_ENABLE_COLUMN_METADATA=1
+export TCLLIBDIR=/dev/null
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ --enable-threadsafe --disable-tcl \
+ --with-readline-inc="-I${PREFIX}/include" \
+ --with-readline-lib="-L${PREFIX}/lib -lreadline -lm -lncurses"
+
+LIBDYLIB=$(SOURCE)/.libs/lib$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/tar/Makefile b/tools/darwin/depends/tar/Makefile
new file mode 100644
index 0000000000..a5bbe13d80
--- /dev/null
+++ b/tools/darwin/depends/tar/Makefile
@@ -0,0 +1,39 @@
+include ../Makefile.include
+
+# app name, version
+APPNAME=tar
+VERSION=1.23
+SOURCE=$(APPNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+export LIBTOOL=builds/unix/libtool
+export PATH:=$(PREFIX)/bin:$(PATH)
+CONFIGURE=./configure --prefix=$(PREFIX) \
+--program-transform-name=s/tar/gtar/ --disable-dependency-tracking
+
+all: $(SOURCE)/src/tar .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(SOURCE)/src/tar: $(SOURCE)
+ cd $(SOURCE); make
+
+.installed:
+ make -C $(SOURCE) install
+ cd $(PREFIX)/bin; ln -s gtar tar; ln -s gtar gnutar
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
+
diff --git a/tools/darwin/depends/tiff/Makefile b/tools/darwin/depends/tiff/Makefile
new file mode 100644
index 0000000000..2082e095e9
--- /dev/null
+++ b/tools/darwin/depends/tiff/Makefile
@@ -0,0 +1,37 @@
+include ../Makefile.include
+
+# lib name, version
+LIBNAME=tiff
+VERSION=3.8.2
+SOURCE=$(LIBNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX)
+
+LIBDYLIB=$(SOURCE)/libtiff/.libs/lib$(LIBNAME).dylib
+
+all: $(LIBDYLIB) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(LIBDYLIB): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed
+
+distclean::
+ rm -rf $(SOURCE) .installed
diff --git a/tools/darwin/depends/xbmc/Makefile b/tools/darwin/depends/xbmc/Makefile
new file mode 100644
index 0000000000..a9285c7fa8
--- /dev/null
+++ b/tools/darwin/depends/xbmc/Makefile
@@ -0,0 +1,15 @@
+include ../Makefile.include
+
+SOURCE=../../../../
+
+# configuration settings
+CONFIGURE=./configure --prefix=$(PREFIX) \
+ PKG_CONFIG_PATH=$(PREFIX)/lib/pkgconfig \
+ PYTHON=$(PREFIX)/bin/python
+
+all: configure
+
+configure:
+ cd $(SOURCE); ./bootstrap
+ cd $(SOURCE); $(CONFIGURE)
+ #cd $(SOURCE); make xcode_depends
diff --git a/tools/darwin/depends/yasm/Makefile b/tools/darwin/depends/yasm/Makefile
new file mode 100644
index 0000000000..997b85d3aa
--- /dev/null
+++ b/tools/darwin/depends/yasm/Makefile
@@ -0,0 +1,41 @@
+include ../Makefile.include
+
+# lib name, version
+APPNAME=yasm
+VERSION=1.1.0
+SOURCE=$(APPNAME)-$(VERSION)
+ARCHIVE=$(SOURCE).tar.gz
+
+# configuration settings
+export PATH:=$(TOOLCHAIN)/bin:$(PATH)
+CONFIGURE=./configure --prefix=$(TOOLCHAIN)
+
+APP=$(SOURCE)/$(APPNAME)
+
+all: $(APP) .installed
+
+$(TARBALLS_LOCATION)/$(ARCHIVE):
+ $(RETRIEVE_TOOL) $(RETRIEVE_TOOL_FLAGS) $(BASE_URL)/$(ARCHIVE)
+
+$(SOURCE): $(TARBALLS_LOCATION)/$(ARCHIVE)
+ rm -rf $(SOURCE)
+ $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE)
+ echo $(SOURCE) > .gitignore
+ cd $(SOURCE); $(CONFIGURE)
+
+$(APP): $(SOURCE)
+ make -C $(SOURCE)
+
+.installed:
+ make -C $(SOURCE) install
+ rm -f $(PREFIX)/bin/yasm
+ ln -s $(TOOLCHAIN)/bin/yasm $(PREFIX)/bin/yasm
+ touch $@
+
+clean:
+ make -C $(SOURCE) clean
+ rm -f .installed $(TOOLCHAIN)/bin/yasm $(PREFIX)/bin/yasm
+
+distclean::
+ rm -rf $(SOURCE) .installed $(TOOLCHAIN)/bin/yasm $(PREFIX)/bin/yasm
+
diff --git a/tools/darwin/runtime/XBMCHelper b/tools/darwin/runtime/XBMCHelper
new file mode 100755
index 0000000000..f47622d417
--- /dev/null
+++ b/tools/darwin/runtime/XBMCHelper
Binary files differ
diff --git a/tools/darwin/runtime/org.xbmc.helper.plist b/tools/darwin/runtime/org.xbmc.helper.plist
new file mode 100644
index 0000000000..206918e563
--- /dev/null
+++ b/tools/darwin/runtime/org.xbmc.helper.plist
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>org.xbmc.helper</string>
+ <key>ProgramArguments</key>
+ <array>
+ <string>${PATH}</string>
+ <string>${ARG1}</string>
+ </array>
+ <key>RunAtLoad</key>
+ <true/>
+</dict>
+</plist>
diff --git a/tools/darwin/runtime/preflight b/tools/darwin/runtime/preflight
new file mode 100755
index 0000000000..e1fa21081c
--- /dev/null
+++ b/tools/darwin/runtime/preflight
@@ -0,0 +1,176 @@
+#!/usr/bin/perl
+
+die("No HOME set, cannot install defaults.\n")
+ if !$ENV{HOME};
+
+die("No XBMC_HOME set, cannot install defaults.\n")
+ if !$ENV{'XBMC_HOME'};
+
+sub get_home {
+ return $ENV{'HOME'} if defined $ENV{'HOME'};
+}
+
+sub get_extras {
+ # XBMC_HOME is assumed to be always setup
+ return $ENV{'XBMC_HOME'}."/extras/" if get_os() eq "osx";
+ return;
+}
+
+sub get_xbmc_home {
+ my $os = get_os();
+ my $home = get_home();
+ return if !defined $home;
+ if ( $os eq "osx" ) {
+ return $home."/Library/Application Support/XBMC";
+ }
+ elsif ( $os eq "linux" ) {
+ return $home."/.xbmc";
+ }
+ return;
+}
+
+sub get_os {
+ if ( defined $ENV{'OSTYPE'} && $ENV{'OSTYPE'} =~ /linux/ ) {
+ return "linux";
+ }
+ return "osx";
+}
+
+sub get_userdata_path {
+ my $xhome = get_xbmc_home();
+ return if !defined $xhome;
+ return "$xhome/userdata";
+}
+
+sub setup_sources {
+ my $xbmchome = get_xbmc_home();
+ my $userdata = get_userdata_path();
+ my $sources = $userdata."/sources.xml";
+
+ # check whether a sources.xml already exists, and if it does back it up
+ if ( -f $sources ) {
+ print STDERR "sources.xml found at \"$sources\", backing up\n";
+ my $backup_sources = $sources.".".time().".xml";
+ `cp -f \"$sources\" \"$backup_sources\"`;
+ }
+
+ # construct a sources.xml string
+ my $sources_xml = get_sources_xml( get_default_sources() );
+ if ( $sources_xml ) {
+ open SOURCES, ">$sources" || exit;
+ print SOURCES get_sources_xml( get_default_sources() );
+ close SOURCES;
+ }
+}
+
+sub get_sources_xml {
+ my $sources = shift;
+ my ($sourcetype, $source);
+
+ return if !defined $sources;
+
+ my $xml = "<sources>\n";
+ while ( ($sourcetype, $source) = each ( %$sources ) ) {
+ $xml .= (" " x 4)."<$sourcetype>\n";
+ $xml .= (" " x 8)."<default></default>\n";
+ my ($name, $path);
+ while ( ($name, $path) = each( %{ $source } ) ) {
+ $xml .= (" " x 8)."<source>\n";
+ $xml .= (" " x 12)."<name>$name</name>\n";
+ if ( $path =~ /(.*)\^\^(.*)/ ) {
+ $xml .= (" " x 12)."<path>".$1."</path>\n";
+ $xml .= (" " x 12)."<thumbnail>".$2."</thumbnail>\n";
+ }
+ else {
+ $xml .= (" " x 12)."<path>".$path."</path>\n";
+ }
+ $xml .= (" " x 8)."</source>\n";
+ }
+ $xml .= (" " x 4)."</$sourcetype>\n";
+ }
+ $xml .= "</sources>\n";
+ return $xml;
+}
+
+sub get_default_sources {
+ my $sources = {};
+ my $home = get_home();
+ my $xbmchome = get_xbmc_home();
+ return if !defined $xbmchome;
+
+ $sources->{'programs'} = {};
+ $sources->{'video'} = {};
+ $sources->{'music'} = {};
+ $sources->{'pictures'} = {};
+ $sources->{'files'} = {};
+
+ if ( get_os() eq "osx" ) {
+
+ # Default sources for OS X
+ $sources->{'music'}->{'Music'} = $home."/Music";
+ $sources->{'music'}->{'Music Playlists'} = "special://musicplaylists";
+ $sources->{'video'}->{'Movies'} = $home."/Movies";
+ $sources->{'video'}->{'Video Playlists'} = "special://videoplaylists";
+ $sources->{'pictures'}->{'Pictures'} = $home."/Pictures";
+ }
+ elsif ( get_os() eq "linux" ) {
+
+ # Default source for Linux
+ for my $key ( keys %$sources ) {
+ $sources->{$key}->{'Media'} = "/media";
+ $sources->{$key}->{'Home'} = "$home";
+ $sources->{$key}->{'Desktop'} = "$home/Desktop";
+ $sources->{$key}->{'Root'} = "/";
+ }
+ }
+ return $sources;
+}
+
+sub first_xbmc_run() {
+ my $home = get_xbmc_home();
+ if ( ! -f "$home/.setup_complete" ) {
+ return 1;
+ }
+ return;
+}
+
+sub first_xbmc_version_run() {
+ my $home = get_xbmc_home();
+ if ( ! -f "$home/.setup_complete" ) {
+ return 1;
+ }
+ return;
+}
+
+sub setup_default_xbmc() {
+ my $extras = get_extras();
+ my $xhome = get_xbmc_home();
+ my $userdata = get_userdata_path();
+
+ die("No extras :(\n")
+ if !defined $extras;
+ die("No XBMC home folder :(\n")
+ if !defined $xhome;
+ die ("No userdata folder :(\n")
+ if !defined $userdata;
+
+ # create userdata directory if it doesn't exist
+ `mkdir -p "$userdata"`;
+ # copy extra stuff to xbmc's userdata directory
+ `cp -fRv "$extras/user/" "$userdata"`;
+
+ setup_sources();
+ `touch -f "$xhome/.setup_complete"`;
+}
+
+sub setup_version_xbmc() {
+ #TODO
+}
+
+if (first_xbmc_run()) {
+ setup_default_xbmc();
+}
+
+if (first_xbmc_version_run()) {
+ setup_version_xbmc();
+}